Angular Common services

Source: Internet
Author: User

In AngularJS, a service is a function or object that can be used in your AngularJS app.

More than 30 services are built in AngularJS.

1. $http Services

$http is the most commonly used service in AngularJS applications. The service sends a request to the server to apply the data sent by the response server.

$http. Get ("http://www.runoob.com/try/angularjs/data/Customers_JSON.php")     = Response.records;});
The above code get request is the server of this station, you cannot copy directly to your local run, there will be cross-domain problem, the solution is to copy the customers_json.php data to your own server, attached: PHP Ajax cross-domain problem best solution.
When loading JSON data from the server,$scope. Names becomes an array.

2.

AngularJS will always monitor applications, handle event changes, and AngularJS use $location services better than using window.location objects.

3.

Angular Common services

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.