How to use AngularJS Services and Controllers
In AngularJS, a service is a function, or object, that is available for, and limited to, your AngularJS application. Services AngularJS has about 30 built-in services. Here I’m going to explain most common used and advanced. The service factory function generates the single object or function that represents the service to the rest of the application. The object or function returned by the service is injected into any component (controller, service, filter or directive) that specifies a dependency on the service Location · The $location service has methods which return information about the location of the current web page: Example: var app = angular.module('myApp', []); app.controller('customersCtrl', function($scope, $location) { $scope.myUrl = $location.mydataUrl(); }); HTTP · The $http service is one of the most comm...