Angularjs Services
# AngularJS Service
In AngularJS, you can create your own services, or use built-in services.
* * *
## What is a Service?
In AngularJS, a service is a function or object that can be used in your AngularJS application.
AngularJS has more than 30 built-in services.
There is a **$location** service, which can return the URL address of the current page.
### Example
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $location) {
$scope.myUrl = $location.absUrl();
});
[Try it Β»](#)
Note that the **$location** service is passed as a parameter to the controller. If you want to use it, you need to define it in the controller.
YouTip