diff options
| author | Misko Hevery | 2011-03-23 09:33:29 -0700 |
|---|---|---|
| committer | Vojta Jina | 2011-08-02 01:00:03 +0200 |
| commit | 8f0dcbab804180828d6859b1340c86cf161209fb (patch) | |
| tree | d13d47d47a1889cb7c96a87cecacd2e25307d51c /docs/content/guide/dev_guide.scopes.updating_scopes.ngdoc | |
| parent | 1f4b417184ce53af15474de065400f8a686430c5 (diff) | |
| download | angular.js-8f0dcbab804180828d6859b1340c86cf161209fb.tar.bz2 | |
feat(scope): new and improved scope implementation
- Speed improvements (about 4x on flush phase)
- Memory improvements (uses no function closures)
- Break $eval into $apply, $dispatch, $flush
- Introduced $watch and $observe
Breaks angular.equals() use === instead of ==
Breaks angular.scope() does not take parent as first argument
Breaks scope.$watch() takes scope as first argument
Breaks scope.$set(), scope.$get are removed
Breaks scope.$config is removed
Breaks $route.onChange callback has not "this" bounded
Diffstat (limited to 'docs/content/guide/dev_guide.scopes.updating_scopes.ngdoc')
| -rw-r--r-- | docs/content/guide/dev_guide.scopes.updating_scopes.ngdoc | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/docs/content/guide/dev_guide.scopes.updating_scopes.ngdoc b/docs/content/guide/dev_guide.scopes.updating_scopes.ngdoc deleted file mode 100644 index 2d5f1725..00000000 --- a/docs/content/guide/dev_guide.scopes.updating_scopes.ngdoc +++ /dev/null @@ -1,38 +0,0 @@ -@workInProgress -@ngdoc overview -@name Developer Guide: Scopes: Updating Scope Properties -@description - -You can update a scope by calling its {@link api/angular.scope.$eval $eval()} method, but usually -you do not have to do this explicitly. In most cases, angular intercepts all external events (such -as user interactions, XHRs, and timers) and calls the `$eval()` method on the scope object for you -at the right time. The only time you might need to call `$eval()` explicitly is when you create -your own custom widget or service. - -The reason it is unnecessary to call `$eval()` from within your controller functions when you use -built-in angular widgets and services is because a change in the data model triggers a call to the -`$eval()` method on the scope object where the data model changed. - -When a user inputs data, angularized widgets copy the data to the appropriate scope and then call -the `$eval()` method on the root scope to update the view. It works this way because scopes are -inherited, and a child scope `$eval()` overrides its parent's `$eval()` method. Updating the whole -page requires a call to `$eval()` on the root scope as `$root.$eval()`. Similarly, when a request -to fetch data from a server is made and the response comes back, the data is written into the model -and then `$eval()` is called to push updates through to the view and any other dependents. - -A widget that creates scopes (such as {@link api/angular.widget.@ng:repeat ng:repeat}) is -responsible for forwarding `$eval()` calls from the parent to those child scopes. That way, calling -`$eval()` on the root scope will update the whole page. This creates a spreadsheet-like behavior -for your app; the bound views update immediately as the user enters data. - - -## Related Documents - -* {@link dev_guide.scopes Angular Scope Objects} -* {@link dev_guide.scopes.understanding_scopes Understanding Angular Scope Objects} -* {@link dev_guide.scopes.working_scopes Working With Angular Scopes} -* {@link dev_guide.scopes.controlling_scopes Applying Controllers to Scopes} - -## Related API - -* {@link api/angular.scope Angular Scope API} |
