Angularjs Service:
Api:https://docs.angularjs.org/api/ng/service below will only introduce a few, if necessary, can go to the official website to view
ANGULARJS services are JavaScript functions for specific tasks that can be reused throughout the application.
Note:Angularjs built-in services start with $ and are the same as other built-in objects.
all the angular services are Lazy Instantiation and the Single Case . This means that the ANGULARJS framework instantiates a service when the application component relies on it . Also, all components share the same service instance .
$ HTTP Service:
$http. Get instance:
Get pass Parameter
post-pass parameter
If you press jquery mode, the pass-through parameter is not available in the background.
We need to make some changes in Angularjs.
Use $http to complete a GET or post submission
$log
ANGULARJS contains the logging service $ log, which logs messages to the browser's console.
$interval
Angularjs includes the $ interval service, which performs the same tasks as the SetInterval () method in JavaScript. $ interval is a wrapper for the SetInterval () method, so it is easy to overwrite.
$ window
Angularjs contains the window service, which points to the browser Windows object.
In JavaScript, window is a global object that contains many built-in methods, such as alert (), prompt (), and so on.
AngularJS Four Service