Skip to content

Commit 26fb884

Browse files
StrikeskidsNarretz
authored andcommitted
docs($rootScope.Scope): improve clarity describing $watch with no listener
The previous explanation in parentheses created a bit of confusion because the documentation stated to leave off the `listener`, but then said "be prepared for multiple calls to your listener". The new explanation clarifies that it is indeed the `watchExpression` that will be executed multiple times. Closes angular#12429
1 parent 0955541 commit 26fb884

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ng/rootScope.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ function $RootScopeProvider() {
274274
*
275275
*
276276
* If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,
277-
* you can register a `watchExpression` function with no `listener`. (Since `watchExpression`
278-
* can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a
279-
* change is detected, be prepared for multiple calls to your listener.)
277+
* you can register a `watchExpression` function with no `listener`. (Be prepared for
278+
* multiple calls to your `watchExpression` because it will execute multiple times in a
279+
* single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.)
280280
*
281281
* After a watcher is registered with the scope, the `listener` fn is called asynchronously
282282
* (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the

0 commit comments

Comments
 (0)