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

Commit 9e538e7

Browse files
gurdigapetebacondarwin
authored andcommitted
docs(ng.$rootScope.Scope): fix API links
Also added a note to the Writing AngularJS Documentation: https://github.com/angular/angular.js/wiki/Writing-AngularJS-Documentation/d0c715ef89 Closes #5261
1 parent 4ac21ac commit 9e538e7

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

src/ng/rootScope.js

+32-32
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ function $RootScopeProvider(){
156156
* @description
157157
* Creates a new child {@link ng.$rootScope.Scope scope}.
158158
*
159-
* The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} and
160-
* {@link ng.$rootScope.Scope#$digest $digest()} events. The scope can be removed from the
161-
* scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.
159+
* The parent scope will propagate the {@link ng.$rootScope.Scope#methods_$digest $digest()} and
160+
* {@link ng.$rootScope.Scope#methods_$digest $digest()} events. The scope can be removed from the
161+
* scope hierarchy using {@link ng.$rootScope.Scope#methods_$destroy $destroy()}.
162162
*
163-
* {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is
163+
* {@link ng.$rootScope.Scope#methods_$destroy $destroy()} must be called on a scope when it is
164164
* desired for the scope and its child scopes to be permanently detached from the parent and
165165
* thus stop participating in model change detection and listener notification by invoking.
166166
*
@@ -213,11 +213,11 @@ function $RootScopeProvider(){
213213
* @description
214214
* Registers a `listener` callback to be executed whenever the `watchExpression` changes.
215215
*
216-
* - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest
216+
* - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#methods_$digest
217217
* $digest()} and should return the value that will be watched. (Since
218-
* {@link ng.$rootScope.Scope#$digest $digest()} reruns when it detects changes the
218+
* {@link ng.$rootScope.Scope#methods_$digest $digest()} reruns when it detects changes the
219219
* `watchExpression` can execute multiple times per
220-
* {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.)
220+
* {@link ng.$rootScope.Scope#methods_$digest $digest()} and should be idempotent.)
221221
* - The `listener` is called only when the value from the current `watchExpression` and the
222222
* previous call to `watchExpression` are not equal (with the exception of the initial run,
223223
* see below). The inequality is determined according to
@@ -229,13 +229,13 @@ function $RootScopeProvider(){
229229
* iteration limit is 10 to prevent an infinite loop deadlock.
230230
*
231231
*
232-
* If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,
232+
* If you want to be notified whenever {@link ng.$rootScope.Scope#methods_$digest $digest} is called,
233233
* you can register a `watchExpression` function with no `listener`. (Since `watchExpression`
234-
* can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a
234+
* can execute multiple times per {@link ng.$rootScope.Scope#methods_$digest $digest} cycle when a
235235
* change is detected, be prepared for multiple calls to your listener.)
236236
*
237237
* After a watcher is registered with the scope, the `listener` fn is called asynchronously
238-
* (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the
238+
* (via {@link ng.$rootScope.Scope#methods_$evalAsync $evalAsync}) to initialize the
239239
* watcher. In rare cases, this is undesirable because the listener is called when the result
240240
* of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you
241241
* can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the
@@ -299,7 +299,7 @@ function $RootScopeProvider(){
299299
*
300300
*
301301
* @param {(function()|string)} watchExpression Expression that is evaluated on each
302-
* {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers
302+
* {@link ng.$rootScope.Scope#methods_$digest $digest} cycle. A change in the return value triggers
303303
* a call to the `listener`.
304304
*
305305
* - `string`: Evaluated as {@link guide/expression expression}
@@ -397,7 +397,7 @@ function $RootScopeProvider(){
397397
*
398398
* @param {string|Function(scope)} obj Evaluated as {@link guide/expression expression}. The
399399
* expression value should evaluate to an object or an array which is observed on each
400-
* {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the
400+
* {@link ng.$rootScope.Scope#methods_$digest $digest} cycle. Any shallow change within the
401401
* collection will trigger a call to the `listener`.
402402
*
403403
* @param {function(newCollection, oldCollection, scope)} listener a callback function that is
@@ -502,22 +502,22 @@ function $RootScopeProvider(){
502502
* @function
503503
*
504504
* @description
505-
* Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and
506-
* its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change
507-
* the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}
505+
* Processes all of the {@link ng.$rootScope.Scope#methods_$watch watchers} of the current scope and
506+
* its children. Because a {@link ng.$rootScope.Scope#methods_$watch watcher}'s listener can change
507+
* the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#methods_$watch watchers}
508508
* until no more listeners are firing. This means that it is possible to get into an infinite
509509
* loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of
510510
* iterations exceeds 10.
511511
*
512512
* Usually, you don't call `$digest()` directly in
513513
* {@link ng.directive:ngController controllers} or in
514514
* {@link ng.$compileProvider#methods_directive directives}.
515-
* Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within
515+
* Instead, you should call {@link ng.$rootScope.Scope#methods_$apply $apply()} (typically from within
516516
* a {@link ng.$compileProvider#methods_directive directives}), which will force a `$digest()`.
517517
*
518518
* If you want to be notified whenever `$digest()` is called,
519519
* you can register a `watchExpression` function with
520-
* {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.
520+
* {@link ng.$rootScope.Scope#methods_$watch $watch()} with no `listener`.
521521
*
522522
* In unit tests, you may need to call `$digest()` to simulate the scope life cycle.
523523
*
@@ -672,7 +672,7 @@ function $RootScopeProvider(){
672672
*
673673
* @description
674674
* Removes the current scope (and all of its children) from the parent scope. Removal implies
675-
* that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer
675+
* that calls to {@link ng.$rootScope.Scope#methods_$digest $digest()} will no longer
676676
* propagate to the current scope and its children. Removal also implies that the current
677677
* scope is eligible for garbage collection.
678678
*
@@ -754,7 +754,7 @@ function $RootScopeProvider(){
754754
*
755755
* - it will execute after the function that scheduled the evaluation (preferably before DOM
756756
* rendering).
757-
* - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after
757+
* - at least one {@link ng.$rootScope.Scope#methods_$digest $digest cycle} will be performed after
758758
* `expression` execution.
759759
*
760760
* Any exceptions from the execution of the expression are forwarded to the
@@ -799,7 +799,7 @@ function $RootScopeProvider(){
799799
* framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).
800800
* Because we are calling into the angular framework we need to perform proper scope life
801801
* cycle of {@link ng.$exceptionHandler exception handling},
802-
* {@link ng.$rootScope.Scope#$digest executing watches}.
802+
* {@link ng.$rootScope.Scope#methods_$digest executing watches}.
803803
*
804804
* ## Life cycle
805805
*
@@ -820,11 +820,11 @@ function $RootScopeProvider(){
820820
* Scope's `$apply()` method transitions through the following stages:
821821
*
822822
* 1. The {@link guide/expression expression} is executed using the
823-
* {@link ng.$rootScope.Scope#$eval $eval()} method.
823+
* {@link ng.$rootScope.Scope#methods_$eval $eval()} method.
824824
* 2. Any exceptions from the execution of the expression are forwarded to the
825825
* {@link ng.$exceptionHandler $exceptionHandler} service.
826-
* 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the
827-
* expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.
826+
* 3. The {@link ng.$rootScope.Scope#methods_$watch watch} listeners are fired immediately after the
827+
* expression was executed using the {@link ng.$rootScope.Scope#methods_$digest $digest()} method.
828828
*
829829
*
830830
* @param {(string|function())=} exp An angular expression to be executed.
@@ -858,7 +858,7 @@ function $RootScopeProvider(){
858858
* @function
859859
*
860860
* @description
861-
* Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for
861+
* Listens on events of a given type. See {@link ng.$rootScope.Scope#methods_$emit $emit} for
862862
* discussion of event life cycle.
863863
*
864864
* The event listener function format is: `function(event, args...)`. The `event` object
@@ -899,20 +899,20 @@ function $RootScopeProvider(){
899899
*
900900
* @description
901901
* Dispatches an event `name` upwards through the scope hierarchy notifying the
902-
* registered {@link ng.$rootScope.Scope#$on} listeners.
902+
* registered {@link ng.$rootScope.Scope#methods_$on} listeners.
903903
*
904904
* The event life cycle starts at the scope on which `$emit` was called. All
905-
* {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get
905+
* {@link ng.$rootScope.Scope#methods_$on listeners} listening for `name` event on this scope get
906906
* notified. Afterwards, the event traverses upwards toward the root scope and calls all
907907
* registered listeners along the way. The event will stop propagating if one of the listeners
908908
* cancels it.
909909
*
910-
* Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed
910+
* Any exception emitted from the {@link ng.$rootScope.Scope#methods_$on listeners} will be passed
911911
* onto the {@link ng.$exceptionHandler $exceptionHandler} service.
912912
*
913913
* @param {string} name Event name to emit.
914914
* @param {...*} args Optional set of arguments which will be passed onto the event listeners.
915-
* @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).
915+
* @return {Object} Event object (see {@link ng.$rootScope.Scope#methods_$on}).
916916
*/
917917
$emit: function(name, args) {
918918
var empty = [],
@@ -968,19 +968,19 @@ function $RootScopeProvider(){
968968
*
969969
* @description
970970
* Dispatches an event `name` downwards to all child scopes (and their children) notifying the
971-
* registered {@link ng.$rootScope.Scope#$on} listeners.
971+
* registered {@link ng.$rootScope.Scope#methods_$on} listeners.
972972
*
973973
* The event life cycle starts at the scope on which `$broadcast` was called. All
974-
* {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get
974+
* {@link ng.$rootScope.Scope#methods_$on listeners} listening for `name` event on this scope get
975975
* notified. Afterwards, the event propagates to all direct and indirect scopes of the current
976976
* scope and calls all registered listeners along the way. The event cannot be canceled.
977977
*
978-
* Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed
978+
* Any exception emitted from the {@link ng.$rootScope.Scope#methods_$on listeners} will be passed
979979
* onto the {@link ng.$exceptionHandler $exceptionHandler} service.
980980
*
981981
* @param {string} name Event name to broadcast.
982982
* @param {...*} args Optional set of arguments which will be passed onto the event listeners.
983-
* @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}
983+
* @return {Object} Event object, see {@link ng.$rootScope.Scope#methods_$on}
984984
*/
985985
$broadcast: function(name, args) {
986986
var target = this,

0 commit comments

Comments
 (0)