Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit b7cb454

Browse files
myitcvrodyhaddad
authored andcommitted
docs($rootScope): fix incorrect docs about how dirty checking is done
1 parent 199825e commit b7cb454

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/ng/rootScope.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,14 @@ function $RootScopeProvider(){
223223
* {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.)
224224
* - The `listener` is called only when the value from the current `watchExpression` and the
225225
* previous call to `watchExpression` are not equal (with the exception of the initial run,
226-
* see below). The inequality is determined according to
227-
* {@link angular.equals} function. To save the value of the object for later comparison,
228-
* the {@link angular.copy} function is used. It also means that watching complex options
229-
* will have adverse memory and performance implications.
226+
* see below). Inequality is determined according to reference inequality,
227+
* [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)
228+
* via the `!==` Javascript operator, unless `objectEquality == true`
229+
* (see next point)
230+
* - When `objectEquality == true`, inequality of the `watchExpression` is determined
231+
* according to the {@link angular.equals} function. To save the value of the object for
232+
* later comparison, the {@link angular.copy} function is used. This therefore means that
233+
* watching complex objects will have adverse memory and performance implications.
230234
* - The watch `listener` may change the model, which may trigger other `listener`s to fire.
231235
* This is achieved by rerunning the watchers until no changes are detected. The rerun
232236
* iteration limit is 10 to prevent an infinite loop deadlock.

0 commit comments

Comments
 (0)