HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
AngularJS you can create your own service, or use the built-in service.
In AngularJS, the service is a function or object can be used in your AngularJS application.
AngularJS built more than 30 services.
There is a$ location service, which returns the URL address of the current page.
Note that$ location service is passed as a parameter to the controller.If you want to use it, you need to be defined in the controller.
$ http AngularJS application is the most commonly used services.The service sends a request to the server, the application server response data transmitted from.
AngularJS constantly monitors application, handle events change, AngularJS use$ location serve better than using window.location.
$ http AngularJS application is the most commonly used services.The service sends a request to the server, the application server response data transmitted from.
Use$ http service request data to the server:
The above is a very simple$ http service instance, more $ httpservice applications Please see AngularJS Http tutorial .
AngularJS $ timeout and services corresponding to the JSwindow.setTimeout function.
Information displayed two seconds:
AngularJS $ interval corresponding to the JSwindow.setInterval service function.
Every two seconds to display information:
You can create a custom service access, links to your module:
Create access namedhexafy of:
To access the custom service, you need to define the filter when the Add Standalone:
Use a custom servicehexafy a digital converter hexadecimal numbers:
When you create a custom service and connect to your application, you can use it in the controller, directives, filters, or other services.
Hexafy use the service in the filter myFormatin:
Getting value in an array of objects you can use filters:
Create Servicehexafy: