The difference between angularjs--ng-bind directives and interpolation values

Source: Internet
Author: User

There are two ways to display the data in a model in ANGULARJS:

One is the way to interpolate with curly braces:

1 < P > {{text}} </ P >

The other is to use attribute-based directives called Ng-bind:

1 <  ng-bind= "text"></p>

The effect of both methods is the same, the main difference is that when using the curly brace syntax, when ANGULARJS uses the data to replace the curly braces in the template, the first loaded page, usually the index.html in the app, is not rendered by the user. Views that use the second method do not experience this problem. The reason is that the browser needs to load the Index.html page first, render it, and then angularjs to parse it into what you expect to see. Therefore, it is recommended to use Ng-bind for data binding operations in index.html pages. The user will not see anything until the data load is complete.

The difference between angularjs--ng-bind directives and interpolation values

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.