Angularjs examples of two-way data binding demo tutorial

Source: Internet
Author: User
Tags angularjs examples

Recently read a book "Proficient in Angularjs", feel good, so do a note to facilitate memory.

A simple angular code:

The results of the operation are as follows:

Binding Ng-app on behalf of the current page BODY element received angular control, Ng-controller bound elements by the angular controller Helloctrl control, $scope is a global object, can be accessed directly on the page $ The properties and methods of scope.

Note: This type of writing applies only when the angular version is below 1.3, and above 1.3, it needs to be written as follows:

The effect is equivalent, but more than a definition of a module app, more in line with the idea of MVC, suggested the following way.

Related Article

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.