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
This commit is contained in:
Vlad GURDIGA 2013-12-04 13:41:00 +02:00 committed by Pete Bacon Darwin
parent 4ac21ac039
commit 9e538e7c31

View file

@ -156,11 +156,11 @@ function $RootScopeProvider(){
* @description * @description
* Creates a new child {@link ng.$rootScope.Scope scope}. * Creates a new child {@link ng.$rootScope.Scope scope}.
* *
* The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} and * The parent scope will propagate the {@link ng.$rootScope.Scope#methods_$digest $digest()} and
* {@link ng.$rootScope.Scope#$digest $digest()} events. The scope can be removed from the * {@link ng.$rootScope.Scope#methods_$digest $digest()} events. The scope can be removed from the
* scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}. * scope hierarchy using {@link ng.$rootScope.Scope#methods_$destroy $destroy()}.
* *
* {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is * {@link ng.$rootScope.Scope#methods_$destroy $destroy()} must be called on a scope when it is
* desired for the scope and its child scopes to be permanently detached from the parent and * desired for the scope and its child scopes to be permanently detached from the parent and
* thus stop participating in model change detection and listener notification by invoking. * thus stop participating in model change detection and listener notification by invoking.
* *
@ -213,11 +213,11 @@ function $RootScopeProvider(){
* @description * @description
* Registers a `listener` callback to be executed whenever the `watchExpression` changes. * Registers a `listener` callback to be executed whenever the `watchExpression` changes.
* *
* - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#methods_$digest
* $digest()} and should return the value that will be watched. (Since * $digest()} and should return the value that will be watched. (Since
* {@link ng.$rootScope.Scope#$digest $digest()} reruns when it detects changes the * {@link ng.$rootScope.Scope#methods_$digest $digest()} reruns when it detects changes the
* `watchExpression` can execute multiple times per * `watchExpression` can execute multiple times per
* {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.) * {@link ng.$rootScope.Scope#methods_$digest $digest()} and should be idempotent.)
* - The `listener` is called only when the value from the current `watchExpression` and the * - 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, * previous call to `watchExpression` are not equal (with the exception of the initial run,
* see below). The inequality is determined according to * see below). The inequality is determined according to
@ -229,13 +229,13 @@ function $RootScopeProvider(){
* iteration limit is 10 to prevent an infinite loop deadlock. * iteration limit is 10 to prevent an infinite loop deadlock.
* *
* *
* If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called, * If you want to be notified whenever {@link ng.$rootScope.Scope#methods_$digest $digest} is called,
* you can register a `watchExpression` function with no `listener`. (Since `watchExpression` * you can register a `watchExpression` function with no `listener`. (Since `watchExpression`
* can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a * can execute multiple times per {@link ng.$rootScope.Scope#methods_$digest $digest} cycle when a
* change is detected, be prepared for multiple calls to your listener.) * change is detected, be prepared for multiple calls to your listener.)
* *
* After a watcher is registered with the scope, the `listener` fn is called asynchronously * After a watcher is registered with the scope, the `listener` fn is called asynchronously
* (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the * (via {@link ng.$rootScope.Scope#methods_$evalAsync $evalAsync}) to initialize the
* watcher. In rare cases, this is undesirable because the listener is called when the result * watcher. In rare cases, this is undesirable because the listener is called when the result
* of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you
* can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the
@ -299,7 +299,7 @@ function $RootScopeProvider(){
* *
* *
* @param {(function()|string)} watchExpression Expression that is evaluated on each * @param {(function()|string)} watchExpression Expression that is evaluated on each
* {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers * {@link ng.$rootScope.Scope#methods_$digest $digest} cycle. A change in the return value triggers
* a call to the `listener`. * a call to the `listener`.
* *
* - `string`: Evaluated as {@link guide/expression expression} * - `string`: Evaluated as {@link guide/expression expression}
@ -397,7 +397,7 @@ function $RootScopeProvider(){
* *
* @param {string|Function(scope)} obj Evaluated as {@link guide/expression expression}. The * @param {string|Function(scope)} obj Evaluated as {@link guide/expression expression}. The
* expression value should evaluate to an object or an array which is observed on each * expression value should evaluate to an object or an array which is observed on each
* {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the * {@link ng.$rootScope.Scope#methods_$digest $digest} cycle. Any shallow change within the
* collection will trigger a call to the `listener`. * collection will trigger a call to the `listener`.
* *
* @param {function(newCollection, oldCollection, scope)} listener a callback function that is * @param {function(newCollection, oldCollection, scope)} listener a callback function that is
@ -502,9 +502,9 @@ function $RootScopeProvider(){
* @function * @function
* *
* @description * @description
* Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and * Processes all of the {@link ng.$rootScope.Scope#methods_$watch watchers} of the current scope and
* its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change * its children. Because a {@link ng.$rootScope.Scope#methods_$watch watcher}'s listener can change
* the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers} * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#methods_$watch watchers}
* until no more listeners are firing. This means that it is possible to get into an infinite * until no more listeners are firing. This means that it is possible to get into an infinite
* loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of
* iterations exceeds 10. * iterations exceeds 10.
@ -512,12 +512,12 @@ function $RootScopeProvider(){
* Usually, you don't call `$digest()` directly in * Usually, you don't call `$digest()` directly in
* {@link ng.directive:ngController controllers} or in * {@link ng.directive:ngController controllers} or in
* {@link ng.$compileProvider#methods_directive directives}. * {@link ng.$compileProvider#methods_directive directives}.
* Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within * Instead, you should call {@link ng.$rootScope.Scope#methods_$apply $apply()} (typically from within
* a {@link ng.$compileProvider#methods_directive directives}), which will force a `$digest()`. * a {@link ng.$compileProvider#methods_directive directives}), which will force a `$digest()`.
* *
* If you want to be notified whenever `$digest()` is called, * If you want to be notified whenever `$digest()` is called,
* you can register a `watchExpression` function with * you can register a `watchExpression` function with
* {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`. * {@link ng.$rootScope.Scope#methods_$watch $watch()} with no `listener`.
* *
* In unit tests, you may need to call `$digest()` to simulate the scope life cycle. * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.
* *
@ -672,7 +672,7 @@ function $RootScopeProvider(){
* *
* @description * @description
* Removes the current scope (and all of its children) from the parent scope. Removal implies * Removes the current scope (and all of its children) from the parent scope. Removal implies
* that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer * that calls to {@link ng.$rootScope.Scope#methods_$digest $digest()} will no longer
* propagate to the current scope and its children. Removal also implies that the current * propagate to the current scope and its children. Removal also implies that the current
* scope is eligible for garbage collection. * scope is eligible for garbage collection.
* *
@ -754,7 +754,7 @@ function $RootScopeProvider(){
* *
* - it will execute after the function that scheduled the evaluation (preferably before DOM * - it will execute after the function that scheduled the evaluation (preferably before DOM
* rendering). * rendering).
* - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after * - at least one {@link ng.$rootScope.Scope#methods_$digest $digest cycle} will be performed after
* `expression` execution. * `expression` execution.
* *
* Any exceptions from the execution of the expression are forwarded to the * Any exceptions from the execution of the expression are forwarded to the
@ -799,7 +799,7 @@ function $RootScopeProvider(){
* framework. (For example from browser DOM events, setTimeout, XHR or third party libraries). * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).
* Because we are calling into the angular framework we need to perform proper scope life * Because we are calling into the angular framework we need to perform proper scope life
* cycle of {@link ng.$exceptionHandler exception handling}, * cycle of {@link ng.$exceptionHandler exception handling},
* {@link ng.$rootScope.Scope#$digest executing watches}. * {@link ng.$rootScope.Scope#methods_$digest executing watches}.
* *
* ## Life cycle * ## Life cycle
* *
@ -820,11 +820,11 @@ function $RootScopeProvider(){
* Scope's `$apply()` method transitions through the following stages: * Scope's `$apply()` method transitions through the following stages:
* *
* 1. The {@link guide/expression expression} is executed using the * 1. The {@link guide/expression expression} is executed using the
* {@link ng.$rootScope.Scope#$eval $eval()} method. * {@link ng.$rootScope.Scope#methods_$eval $eval()} method.
* 2. Any exceptions from the execution of the expression are forwarded to the * 2. Any exceptions from the execution of the expression are forwarded to the
* {@link ng.$exceptionHandler $exceptionHandler} service. * {@link ng.$exceptionHandler $exceptionHandler} service.
* 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the * 3. The {@link ng.$rootScope.Scope#methods_$watch watch} listeners are fired immediately after the
* expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method. * expression was executed using the {@link ng.$rootScope.Scope#methods_$digest $digest()} method.
* *
* *
* @param {(string|function())=} exp An angular expression to be executed. * @param {(string|function())=} exp An angular expression to be executed.
@ -858,7 +858,7 @@ function $RootScopeProvider(){
* @function * @function
* *
* @description * @description
* Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for * Listens on events of a given type. See {@link ng.$rootScope.Scope#methods_$emit $emit} for
* discussion of event life cycle. * discussion of event life cycle.
* *
* The event listener function format is: `function(event, args...)`. The `event` object * The event listener function format is: `function(event, args...)`. The `event` object
@ -899,20 +899,20 @@ function $RootScopeProvider(){
* *
* @description * @description
* Dispatches an event `name` upwards through the scope hierarchy notifying the * Dispatches an event `name` upwards through the scope hierarchy notifying the
* registered {@link ng.$rootScope.Scope#$on} listeners. * registered {@link ng.$rootScope.Scope#methods_$on} listeners.
* *
* The event life cycle starts at the scope on which `$emit` was called. All * The event life cycle starts at the scope on which `$emit` was called. All
* {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get * {@link ng.$rootScope.Scope#methods_$on listeners} listening for `name` event on this scope get
* notified. Afterwards, the event traverses upwards toward the root scope and calls all * notified. Afterwards, the event traverses upwards toward the root scope and calls all
* registered listeners along the way. The event will stop propagating if one of the listeners * registered listeners along the way. The event will stop propagating if one of the listeners
* cancels it. * cancels it.
* *
* Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed * Any exception emitted from the {@link ng.$rootScope.Scope#methods_$on listeners} will be passed
* onto the {@link ng.$exceptionHandler $exceptionHandler} service. * onto the {@link ng.$exceptionHandler $exceptionHandler} service.
* *
* @param {string} name Event name to emit. * @param {string} name Event name to emit.
* @param {...*} args Optional set of arguments which will be passed onto the event listeners. * @param {...*} args Optional set of arguments which will be passed onto the event listeners.
* @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}). * @return {Object} Event object (see {@link ng.$rootScope.Scope#methods_$on}).
*/ */
$emit: function(name, args) { $emit: function(name, args) {
var empty = [], var empty = [],
@ -968,19 +968,19 @@ function $RootScopeProvider(){
* *
* @description * @description
* Dispatches an event `name` downwards to all child scopes (and their children) notifying the * Dispatches an event `name` downwards to all child scopes (and their children) notifying the
* registered {@link ng.$rootScope.Scope#$on} listeners. * registered {@link ng.$rootScope.Scope#methods_$on} listeners.
* *
* The event life cycle starts at the scope on which `$broadcast` was called. All * The event life cycle starts at the scope on which `$broadcast` was called. All
* {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get * {@link ng.$rootScope.Scope#methods_$on listeners} listening for `name` event on this scope get
* notified. Afterwards, the event propagates to all direct and indirect scopes of the current * notified. Afterwards, the event propagates to all direct and indirect scopes of the current
* scope and calls all registered listeners along the way. The event cannot be canceled. * scope and calls all registered listeners along the way. The event cannot be canceled.
* *
* Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed * Any exception emitted from the {@link ng.$rootScope.Scope#methods_$on listeners} will be passed
* onto the {@link ng.$exceptionHandler $exceptionHandler} service. * onto the {@link ng.$exceptionHandler $exceptionHandler} service.
* *
* @param {string} name Event name to broadcast. * @param {string} name Event name to broadcast.
* @param {...*} args Optional set of arguments which will be passed onto the event listeners. * @param {...*} args Optional set of arguments which will be passed onto the event listeners.
* @return {Object} Event object, see {@link ng.$rootScope.Scope#$on} * @return {Object} Event object, see {@link ng.$rootScope.Scope#methods_$on}
*/ */
$broadcast: function(name, args) { $broadcast: function(name, args) {
var target = this, var target = this,