diff options
Diffstat (limited to 'docs/content/guide/concepts.ngdoc')
| -rw-r--r-- | docs/content/guide/concepts.ngdoc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/docs/content/guide/concepts.ngdoc b/docs/content/guide/concepts.ngdoc index bab511bd..bbf12b32 100644 --- a/docs/content/guide/concepts.ngdoc +++ b/docs/content/guide/concepts.ngdoc @@ -75,26 +75,26 @@ directive which is handling the event. An explicit call to $apply is needed only implementing custom event callbacks, or when working with third-party library callbacks. 1. Enter Angular execution context by calling {@link guide/scope scope}`.`{@link - api/ng.$rootScope.Scope#$apply $apply}`(stimulusFn)`. Where `stimulusFn` is + api/ng.$rootScope.Scope#methods_$apply $apply}`(stimulusFn)`. Where `stimulusFn` is the work you wish to do in Angular execution context. 2. Angular executes the `stimulusFn()`, which typically modifies application state. - 3. Angular enters the {@link api/ng.$rootScope.Scope#$digest $digest} loop. The + 3. Angular enters the {@link api/ng.$rootScope.Scope#methods_$digest $digest} loop. The loop is made up of two smaller loops which process {@link - api/ng.$rootScope.Scope#$evalAsync $evalAsync} queue and the {@link - api/ng.$rootScope.Scope#$watch $watch} list. The {@link - api/ng.$rootScope.Scope#$digest $digest} loop keeps iterating until the model - stabilizes, which means that the {@link api/ng.$rootScope.Scope#$evalAsync - $evalAsync} queue is empty and the {@link api/ng.$rootScope.Scope#$watch + api/ng.$rootScope.Scope#methods_$evalAsync $evalAsync} queue and the {@link + api/ng.$rootScope.Scope#methods_$watch $watch} list. The {@link + api/ng.$rootScope.Scope#methods_$digest $digest} loop keeps iterating until the model + stabilizes, which means that the {@link api/ng.$rootScope.Scope#methods_$evalAsync + $evalAsync} queue is empty and the {@link api/ng.$rootScope.Scope#methods_$watch $watch} list does not detect any changes. - 4. The {@link api/ng.$rootScope.Scope#$evalAsync $evalAsync} queue is used to + 4. The {@link api/ng.$rootScope.Scope#methods_$evalAsync $evalAsync} queue is used to schedule work which needs to occur outside of current stack frame, but before the browser's view render. This is usually done with `setTimeout(0)`, but the `setTimeout(0)` approach suffers from slowness and may cause view flickering since the browser renders the view after each event. - 5. The {@link api/ng.$rootScope.Scope#$watch $watch} list is a set of expressions + 5. The {@link api/ng.$rootScope.Scope#methods_$watch $watch} list is a set of expressions which may have changed since last iteration. If a change is detected then the `$watch` function is called which typically updates the DOM with the new value. - 6. Once the Angular {@link api/ng.$rootScope.Scope#$digest $digest} loop finishes + 6. Once the Angular {@link api/ng.$rootScope.Scope#methods_$digest $digest} loop finishes the execution leaves the Angular and JavaScript context. This is followed by the browser re-rendering the DOM to reflect any changes. @@ -107,17 +107,17 @@ user enters text into the text field. api/ng.directive:input input} {@link guide/directive directive} set up a `keydown` listener on the `<input>` control. 2. the {@link api/ng.$interpolate {{name}} } interpolation - sets up a {@link api/ng.$rootScope.Scope#$watch $watch} to be notified of + sets up a {@link api/ng.$rootScope.Scope#methods_$watch $watch} to be notified of `name` changes. 2. During the runtime phase: 1. Pressing an '`X`' key causes the browser to emit a `keydown` event on the input control. 2. The {@link api/ng.directive:input input} directive captures the change to the input's value and calls {@link - api/ng.$rootScope.Scope#$apply $apply}`("name = 'X';")` to update the + api/ng.$rootScope.Scope#methods_$apply $apply}`("name = 'X';")` to update the application model inside the Angular execution context. 3. Angular applies the `name = 'X';` to the model. - 4. The {@link api/ng.$rootScope.Scope#$digest $digest} loop begins - 5. The {@link api/ng.$rootScope.Scope#$watch $watch} list detects a change + 4. The {@link api/ng.$rootScope.Scope#methods_$digest $digest} loop begins + 5. The {@link api/ng.$rootScope.Scope#methods_$watch $watch} list detects a change on the `name` property and notifies the {@link api/ng.$interpolate {{name}} } interpolation, which in turn updates the DOM. 6. Angular exits the execution context, which in turn exits the `keydown` event and with it @@ -253,7 +253,7 @@ rendering the view compared to most other templating systems. template sprinkled in.) The browser parses the HTML into the DOM, and the DOM becomes the input to the template engine known as the {@link api/ng.$compile compiler}. The compiler looks for {@link guide/directive directives} which in turn set up {@link - api/ng.$rootScope.Scope#$watch watches} on the model. The result is a + api/ng.$rootScope.Scope#methods_$watch watches} on the model. The result is a continuously updating view which does not need template model re-merging. Your model becomes the single source-of-truth for your view. @@ -377,8 +377,8 @@ as a {@link api/AUTO.$provide provider}. But the real magic of the {@link api/AUTO.$injector injector} is that it can be -used to {@link api/AUTO.$injector#invoke call} methods and {@link -api/AUTO.$injector#instantiate instantiate} types. This subtle feature is what +used to {@link api/AUTO.$injector#methods_invoke call} methods and {@link +api/AUTO.$injector#methods_instantiate instantiate} types. This subtle feature is what allows the methods and types to ask for their dependencies instead of having to look for them. <pre> @@ -406,7 +406,7 @@ allows the methods and types to ask for their dependencies instead of having to Notice that the only thing you needed to write was the function, and list the dependencies in the function arguments. When angular calls the function, it will use the {@link -api/AUTO.$injector#invoke call} which will automatically fill the function +api/AUTO.$injector#methods_invoke call} which will automatically fill the function arguments. Examine the `ClockCtrl` below, and notice how it lists the dependencies in the constructor. When the |
