4.AngularJS four characteristics of two: two-way data binding

Source: Internet
Author: User

Two four characteristics of Angularjs: two-way data binding

(1) Direction one: The model data is bound to the view-then whenever the model has changed, the rendering in view will change immediately! Implementation method:

{{}}, Ngbind, Ngrepeat, Ngif, Ngsrc, Ngstyle ... All implement the binding of direction 1.

(2) Direction Two: Modify the View (Form control) to bind to the model-at any time thereafter, whenever the data in the view is modified, the data in the model is automatically modified. Implementation method: only Ngmodel instructions .

Tip: You can use the $scope. $watch (' model variable name ', FN) to monitor a change in the value of a model variable; a single-line text input field, a multiline text input field, a drop-down box, a radio button control, by default, binds one of its Value property values to a model variable; check box will put a true The/false value is bound to a model variable.

Services provided in NG module (service)

(1) $rootScope: For sharing data between different controllers

(2) $interval: Provide periodic timer service

(3) $timeout: Disposable Timer service available

(4) $http: Initiating an asynchronous AJAX request service

4.AngularJS four characteristics of two: two-way data binding

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.