Common errors in Angularjs

Source: Internet
Author: User

Use Angularjs time is not very long, understanding is not thorough. But for those who have just started learning, they can help.

1. callback function.

。

。。。 --and remember that it's asynchronous, and there's an inexplicable problem remember to check

2. Memory leaks.

。。。。 --a very wide variety of possibilities, and this remains to be seen. The situation I encountered was to write a function with a return value in the Ng-repeat, and then he kept calling this function, causing the memory leak, should write a ng-init= "function" before Ng-repeat, Then put the return value into a scope scope variable, ng-repeat= "This variable", so it is conquered.

3. $http:

。。。。

---> is an asynchronous transfer via Ajax after putting the results into $scope, he automatically triggers a $apply () dirty check. And with $.ajax you need to manually trigger.

Common errors in Angularjs

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.