What is scope ($scope) in angularjs? How to define/use scope in angularjs?


scope is an object refers to a model can have data and it propagates events. It is a communication between view and controller (in mvc pattern) or view and view model (in mvvm pattern).

Ex:

angular.module('testApp', [])
.controller('TestController', ['$scope', function($scope) {

  $scope.onClick = function() {
   //do something
  };
}]);

What is a module in Angular JS? How to create a Angular JS module?


Angular module is a collection functions and that are run when the application starts.

Creating the module.

var app = angular.module('testApp', []);

How to Call a Web Service in SQL Server?

We can create a function in Sql Server to call .net dll which can contain web service call or any .net code.

CREATE FUNCTION <[Function Name]>(<parameter(s)>)
RETURNS <Return Type> WITH EXECUTE AS CALLER
AS
EXTERNAL NAME <Assembly Name>.<Class Name>.<Method Name>


Example:

CREATE FUNCTION GetDataFromXYZService(@ID [navarchar](10))
RETURNS [nvarchar](max) WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [AssemblyToGetDataFromXYZService].[GetDataClass].[GetDataMethod]

here AssemblyToGetDataFromXYZService is SQL assembly.

click here to check how to create AssemblyToGetDataFromXYZService assembly in SQL server using .net assembly.