mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 15:40:22 +00:00
35 lines
1.6 KiB
Text
35 lines
1.6 KiB
Text
@ngdoc overview
|
|
@name Developer Guide: Scopes
|
|
@description
|
|
|
|
|
|
An Angular scope is a JavaScript object with additional APIs useful for watching property changes,
|
|
Angular scope is the model in Model-View-Controller paradigm. Instances of scope serve as the
|
|
context within which all {@link dev_guide.expressions expressions} get evaluated.
|
|
|
|
You can think of Angular scope objects as the medium through which the model, view, and controller
|
|
communicate. Scopes are linked during the compilation process with the view. This linkage provides
|
|
the contexts in which Angular creates data-bindings between the model and the view.
|
|
|
|
In addition to providing the context in which data is evaluated, Angular scope objects watch for
|
|
model changes. The scope objects also notify all components interested in any model changes (for
|
|
example, functions registered through {@link api/angular.module.ng.$rootScope.Scope#$watch $watch}, bindings created by
|
|
{@link api/angular.module.ng.$compileProvider.directive.ngBind ngBind}, or HTML input elements).
|
|
|
|
Angular scope objects:
|
|
|
|
* Link the model, controller and view template together.
|
|
* Provide the mechanism to watch for model changes ({@link api/angular.module.ng.$rootScope.Scope#$watch $watch}).
|
|
* Apply model changes to the system ({@link api/angular.module.ng.$rootScope.Scope#$apply $apply}).
|
|
* Provide the context in which expressions are evaluated ({@link api/angular.module.ng.$rootScope.Scope#$eval $eval}).
|
|
|
|
|
|
## Related Topics
|
|
|
|
* {@link dev_guide.scopes.understanding_scopes Understanding Scopes}
|
|
* {@link dev_guide.scopes.internals Scopes Internals}
|
|
|
|
## Related API
|
|
|
|
* {@link api/angular.module.ng.$rootScope.Scope Angular Scope API}
|
|
|