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

Commit d8c5586

Browse files
committed
docs(guide/$location): clarify "$watchers" / "$observers" terminology with links
Add links to API docs for Scope#$watch and Attributes#$observe in $location in order to clarify the meaning of that terminology. Closes #7497
1 parent 92f588c commit d8c5586

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/content/guide/$location.ngdoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ changes to $location are reflected into the browser address bar.
4949
<tr>
5050
<td class="head">integration with angular application life-cycle</td>
5151
<td>none</td>
52-
<td>knows about all internal life-cycle phases, integrates with $watch, ...</td>
52+
<td>knows about all internal life-cycle phases, integrates with {@link ng.$rootScope.Scope#$watch $watch}, ...</td>
5353
</tr>
5454

5555
<tr>
@@ -482,10 +482,12 @@ use a lower level API, {@link ng.$window $window.location.href}.
482482
## Using $location outside of the scope life-cycle
483483

484484
`$location` knows about Angular's {@link ng.$rootScope.Scope scope} life-cycle. When a URL changes in
485-
the browser it updates the `$location` and calls `$apply` so that all $watchers / $observers are
486-
notified.
485+
the browser it updates the `$location` and calls `$apply` so that all
486+
{@link ng.$rootScope.Scope#$watch $watchers} /
487+
{@link ng.$compile.directive.Attributes#$observe $observers} are notified.
487488
When you change the `$location` inside the `$digest` phase everything is ok; `$location` will
488-
propagate this change into browser and will notify all the $watchers / $observers.
489+
propagate this change into browser and will notify all the {@link ng.$rootScope.Scope#$watch $watchers} /
490+
{@link ng.$compile.directive.Attributes#$observe $observers}.
489491
When you want to change the `$location` from outside Angular (for example, through a DOM Event or
490492
during testing) - you must call `$apply` to propagate the changes.
491493

@@ -618,7 +620,7 @@ then uses the information it obtains to compose hashbang URLs (such as
618620

619621
The Angular's compiler currently does not support two-way binding for methods (see [issue](https://github.com/angular/angular.js/issues/404)). If you should require two-way binding
620622
to the $location object (using {@link input[text] ngModel} directive on an input
621-
field), you will need to specify an extra model property (e.g. `locationPath`) with two watchers
623+
field), you will need to specify an extra model property (e.g. `locationPath`) with two {@link ng.$rootScope.Scope#$watch $watchers}
622624
which push $location updates in both directions. For example:
623625
<example>
624626
<file name="index.html">

0 commit comments

Comments
 (0)