Angularjs Study Notes (3)--scope

Source: Internet
Author: User

when AngularJS starts and generates a view, the root ng-app element is bound to the $rootScope .

The $rootScope is the topmost of all $scope objects and is the object closest to the global scope in AngularJS.

A ng-app can have multiple controllers, $scope range is limited to each controller

$scope object is an ordinary JavaScript object that we can arbitrarily modify or add properties to.

Scopes provide the ability to monitor changes in the data model, and All Properties $scope can be automatically accessed by the view

The

Scope is the basis for the application state dynamic binding we can Dependent view updates the $scope can also dependent $scope Re-render the view as soon as it changes  

$scope Objects Act as data models in AngularJS , but unlike traditional data models, $scope are not responsible for
and manipulate data, which is just the link between HTML (view) and JavaScript (Controller)

Directives are widely used in AngularJS, and directives typically do not create their own $scope, but there are exceptions. Like what
The Ng-controller and ng-repeat directives create their own child scopes and attach them to DOM elements

Angularjs Study Notes (3)--scope

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.