mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-06 09:01:31 +08:00
docs($rootScope): fix incorrect docs about how dirty checking is done
This commit is contained in:
@@ -223,10 +223,14 @@ function $RootScopeProvider(){
|
||||
* {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.)
|
||||
* - The `listener` is called only when the value from the current `watchExpression` and the
|
||||
* previous call to `watchExpression` are not equal (with the exception of the initial run,
|
||||
* see below). The inequality is determined according to
|
||||
* {@link angular.equals} function. To save the value of the object for later comparison,
|
||||
* the {@link angular.copy} function is used. It also means that watching complex options
|
||||
* will have adverse memory and performance implications.
|
||||
* see below). Inequality is determined according to reference inequality,
|
||||
* [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)
|
||||
* via the `!==` Javascript operator, unless `objectEquality == true`
|
||||
* (see next point)
|
||||
* - When `objectEquality == true`, inequality of the `watchExpression` is determined
|
||||
* according to the {@link angular.equals} function. To save the value of the object for
|
||||
* later comparison, the {@link angular.copy} function is used. This therefore means that
|
||||
* watching complex objects will have adverse memory and performance implications.
|
||||
* - The watch `listener` may change the model, which may trigger other `listener`s to fire.
|
||||
* This is achieved by rerunning the watchers until no changes are detected. The rerun
|
||||
* iteration limit is 10 to prevent an infinite loop deadlock.
|
||||
|
||||
Reference in New Issue
Block a user