diff options
Diffstat (limited to 'docs/content/guide')
| -rw-r--r-- | docs/content/guide/animations.ngdoc | 14 | ||||
| -rw-r--r-- | docs/content/guide/compiler.ngdoc | 4 | ||||
| -rw-r--r-- | docs/content/guide/concepts.ngdoc | 36 | ||||
| -rw-r--r-- | docs/content/guide/directive.ngdoc | 28 | ||||
| -rw-r--r-- | docs/content/guide/expression.ngdoc | 2 | ||||
| -rw-r--r-- | docs/content/guide/forms.ngdoc | 8 | ||||
| -rw-r--r-- | docs/content/guide/scope.ngdoc | 38 |
7 files changed, 65 insertions, 65 deletions
diff --git a/docs/content/guide/animations.ngdoc b/docs/content/guide/animations.ngdoc index 737e97a1..80e7377d 100644 --- a/docs/content/guide/animations.ngdoc +++ b/docs/content/guide/animations.ngdoc @@ -253,13 +253,13 @@ The table below explains in detail which animation events are triggered | Directive | Supported Animations | |-------------------------------------------------------------------------------------|------------------------------------------| -| {@link api/ng.directive:ngRepeat#animations ngRepeat} | enter, leave, and move | -| {@link api/ngRoute.directive:ngView#animations ngView} | enter and leave | -| {@link api/ng.directive:ngInclude#animations ngInclude} | enter and leave | -| {@link api/ng.directive:ngSwitch#animations ngSwitch} | enter and leave | -| {@link api/ng.directive:ngIf#animations ngIf} | enter and leave | -| {@link api/ng.directive:ngShow#animations ngClass or {{class}}} | add and remove | -| {@link api/ng.directive:ngShow#animations ngShow & ngHide} | add and remove (the ng-hide class value) | +| {@link api/ng.directive:ngRepeat#usage_animations ngRepeat} | enter, leave, and move | +| {@link api/ngRoute.directive:ngView#usage_animations ngView} | enter and leave | +| {@link api/ng.directive:ngInclude#usage_animations ngInclude} | enter and leave | +| {@link api/ng.directive:ngSwitch#usage_animations ngSwitch} | enter and leave | +| {@link api/ng.directive:ngIf#usage_animations ngIf} | enter and leave | +| {@link api/ng.directive:ngShow#usage_animations ngClass or {{class}}} | add and remove | +| {@link api/ng.directive:ngShow#usage_animations ngShow & ngHide} | add and remove (the ng-hide class value) | For a full breakdown of the steps involved during each animation event, refer to the {@link api/ngAnimate.$animate API docs}. diff --git a/docs/content/guide/compiler.ngdoc b/docs/content/guide/compiler.ngdoc index a258055b..257722e6 100644 --- a/docs/content/guide/compiler.ngdoc +++ b/docs/content/guide/compiler.ngdoc @@ -7,7 +7,7 @@ Angular's {@link api/ng.$compile HTML compiler} allows the developer to teach the browser new HTML syntax. The compiler allows you to attach behavior to any HTML element or attribute and even create new HTML elements or attributes with custom behavior. Angular calls these behavior -extensions {@link api/ng.$compileProvider#directive directives}. +extensions {@link api/ng.$compileProvider#methods_directive directives}. HTML has a lot of constructs for formatting the HTML for static documents in a declarative fashion. For example if something needs to be centered, there is no need to provide instructions to the @@ -59,7 +59,7 @@ api/ng.directive:ngBind `ng-bind`} directive. </pre> A directive is just a function which executes when the compiler encounters it in the DOM. See {@link -api/ng.$compileProvider#directive directive API} for in-depth documentation on how +api/ng.$compileProvider#methods_directive directive API} for in-depth documentation on how to write directives. Here is a directive which makes any element draggable. Notice the `draggable` attribute on the 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 diff --git a/docs/content/guide/directive.ngdoc b/docs/content/guide/directive.ngdoc index 36c0f719..f548164f 100644 --- a/docs/content/guide/directive.ngdoc +++ b/docs/content/guide/directive.ngdoc @@ -58,8 +58,8 @@ The following demonstrates the various ways a Directive (ngBind in this case) ca During the compilation process the {@link api/ng.$compile compiler} matches text and attributes using the {@link api/ng.$interpolate $interpolate} service to see if they contain embedded expressions. These expressions are registered as {@link -api/ng.$rootScope.Scope#$watch watches} which will be processed as part of the normal {@link -api/ng.$rootScope.Scope#$digest digest} cycle. An example of interpolation is shown +api/ng.$rootScope.Scope#methods_$watch watches} which will be processed as part of the normal {@link +api/ng.$rootScope.Scope#methods_$digest digest} cycle. An example of interpolation is shown here: <pre> @@ -112,7 +112,7 @@ Compilation of HTML happens in three phases: 3. Link the template with a scope by calling the linking function returned from the previous step. This in turn will call the linking function of the individual directives allowing them to register any listeners on the elements and set up any {@link - api/ng.$rootScope.Scope#$watch watches} with the {@link + api/ng.$rootScope.Scope#methods_$watch watches} with the {@link api/ng.$rootScope.Scope scope}. The result is a live binding between the scope and the DOM (i.e., a change in the scope is reflected in the DOM). @@ -294,7 +294,7 @@ Here's an example directive declared with a Directive Definition Object: In most cases you will not need such fine control, so the above can be simplified. You could still return a Directive Definition Object, but only set the 'link' function property of the Object -and rely on the default values for other properties. +and rely on the default values for other properties. Therefore the above could be simplified as: @@ -317,7 +317,7 @@ Therefore the above could be simplified as: The factory method is responsible for creating the directive. It is invoked only once, when the {@link api/ng.$compile compiler} matches the directive for the first time. You can perform any initialization work here. The method is invoked using the {@link -api/AUTO.$injector#invoke $injector.invoke} which +api/AUTO.$injector#methods_invoke $injector.invoke} which makes it injectable (subject to all of the rules of the injection annotation). ## Directive Definition Object @@ -415,7 +415,7 @@ compiler}. The attributes are: * `template` - replace the current element with the contents of the given HTML. The replacement process migrates all of the attributes / classes from the old element to the new one. See the - {@link guide/directive#Components Creating Components} section below for more information. + {@link guide/directive#creating-components Creating Components} section below for more information. You can specify `template` as a string representing the template or as a function which takes two arguments `tElement` and `tAttrs` (described in the `compile` function api below) and @@ -428,7 +428,7 @@ compiler}. The attributes are: You can specify `templateUrl` as a string representing the URL or as a function which takes two arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns a string value representing the url. In either case, the template URL is passed through {@link - api/ng.$sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}. + api/ng.$sce#methods_getTrustedResourceUrl $sce.getTrustedResourceUrl}. * `replace` - specify where the template should be inserted. Defaults to `false`. @@ -471,7 +471,7 @@ compile function takes the following arguments: * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared between all directive compile functions. See {@link - guide/directive#Attributes Attributes}. + guide/directive#writing-directives_attributes Attributes}. * `transclude` - A transclude linking function: `function(scope, cloneLinkingFn)`. @@ -480,10 +480,10 @@ been cloned. For this reason it is not safe to do anything in the compile functi transformation that applies to all DOM clones. Specifically, DOM listener registration should be done in a linking function rather than in a compile function. -A compile function can have a return value which can be either a function or an object. Returning a -(post-link) function is equivalent to registering the linking function via the 'link` property of -the config object when the compile function is empty. Returning an object with function(s) registered -via `pre` and `post` properties allows you to control when a linking function should be called during +A compile function can have a return value which can be either a function or an object. Returning a +(post-link) function is equivalent to registering the linking function via the 'link` property of +the config object when the compile function is empty. Returning an object with function(s) registered +via `pre` and `post` properties allows you to control when a linking function should be called during the linking phase. See info about pre-linking and post-linking functions below. @@ -498,7 +498,7 @@ executed after the template has been cloned. This is where most of the directive put. * `scope` - {@link api/ng.$rootScope.Scope Scope} - The scope to be used by the - directive for registering {@link api/ng.$rootScope.Scope#$watch watches}. + directive for registering {@link api/ng.$rootScope.Scope#methods_$watch watches}. * `iElement` - instance element - The element where the directive is to be used. It is safe to manipulate the children of the element only in `postLink` function since the children have @@ -506,7 +506,7 @@ put. * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared between all directive linking functions. See {@link - guide/directive#Attributes Attributes}. + guide/directive#writing-directives_attributes Attributes}. * `controller` - a controller instance - A controller instance if at least one directive on the element defines a controller. The controller is shared among all the directives, which allows diff --git a/docs/content/guide/expression.ngdoc b/docs/content/guide/expression.ngdoc index eae41fcf..980bb136 100644 --- a/docs/content/guide/expression.ngdoc +++ b/docs/content/guide/expression.ngdoc @@ -34,7 +34,7 @@ You can think of Angular expressions as JavaScript expressions with following di If, on the other hand, you do want to run arbitrary JavaScript code, you should make it a controller method and call the method. If you want to `eval()` an angular expression from -JavaScript, use the {@link api/ng.$rootScope.Scope#$eval `$eval()`} method. +JavaScript, use the {@link api/ng.$rootScope.Scope#methods_$eval `$eval()`} method. ## Example <doc:example> diff --git a/docs/content/guide/forms.ngdoc b/docs/content/guide/forms.ngdoc index d8488a02..f3f95b7c 100644 --- a/docs/content/guide/forms.ngdoc +++ b/docs/content/guide/forms.ngdoc @@ -186,11 +186,11 @@ To get a hold of the controller the directive specifies a dependency as shown in The validation can occur in two places: * **Model to View update** - - Whenever the bound model changes, all functions in {@link api/ng.directive:ngModel.NgModelController#$formatters NgModelController#$formatters} array are pipe-lined, so that each of these functions has an opportunity to format the value and change validity state of the form control through {@link api/ng.directive:ngModel.NgModelController#$setValidity NgModelController#$setValidity}. + Whenever the bound model changes, all functions in {@link api/ng.directive:ngModel.NgModelController#properties_$formatters NgModelController#$formatters} array are pipe-lined, so that each of these functions has an opportunity to format the value and change validity state of the form control through {@link api/ng.directive:ngModel.NgModelController#methods_$setValidity NgModelController#$setValidity}. * **View to Model update** - - In a similar way, whenever a user interacts with a control it calls {@link api/ng.directive:ngModel.NgModelController#$setViewValue NgModelController#$setViewValue}. -This in turn pipelines all functions in the {@link api/ng.directive:ngModel.NgModelController#$parsers NgModelController#$parsers} array, so that each of these functions has an opportunity to convert the value and change validity state of the form control through {@link api/ng.directive:ngModel.NgModelController#$setValidity NgModelController#$setValidity}. + In a similar way, whenever a user interacts with a control it calls {@link api/ng.directive:ngModel.NgModelController#methods_$setViewValue NgModelController#$setViewValue}. +This in turn pipelines all functions in the {@link api/ng.directive:ngModel.NgModelController#properties_$parsers NgModelController#$parsers} array, so that each of these functions has an opportunity to convert the value and change validity state of the form control through {@link api/ng.directive:ngModel.NgModelController#methods_$setValidity NgModelController#$setValidity}. In the following example we create two directives. @@ -278,7 +278,7 @@ However, if you need more flexibility, you can write your own form control as a In order for custom control to work with `ngModel` and to achieve two-way data-binding it needs to: - - implement `$render` method, which is responsible for rendering the data after it passed the {@link api/ng.directive:ngModel.NgModelController#$formatters NgModelController#$formatters}, + - implement `$render` method, which is responsible for rendering the data after it passed the {@link api/ng.directive:ngModel.NgModelController#properties_$formatters NgModelController#$formatters}, - call `$setViewValue` method, whenever the user interacts with the control and model needs to be updated. This is usually done inside a DOM Event listener. See {@link guide/directive $compileProvider.directive} for more info. diff --git a/docs/content/guide/scope.ngdoc b/docs/content/guide/scope.ngdoc index 411384ff..629d3782 100644 --- a/docs/content/guide/scope.ngdoc +++ b/docs/content/guide/scope.ngdoc @@ -11,10 +11,10 @@ watch {@link guide/expression expressions} and propagate events. ## Scope characteristics - - Scopes provide APIs ({@link api/ng.$rootScope.Scope#$watch $watch}) to observe + - Scopes provide APIs ({@link api/ng.$rootScope.Scope#methods_$watch $watch}) to observe model mutations. - - Scopes provide APIs ({@link api/ng.$rootScope.Scope#$apply $apply}) to + - Scopes provide APIs ({@link api/ng.$rootScope.Scope#methods_$apply $apply}) to propagate any model changes through the system into the view from outside of the "Angular realm" (controllers, services, Angular event handlers). @@ -28,8 +28,8 @@ watch {@link guide/expression expressions} and propagate events. ## Scope as Data-Model Scope is the glue between application controller and the view. During the template {@link compiler -linking} phase the {@link api/ng.$compileProvider#directive directives} set up -{@link api/ng.$rootScope.Scope#$watch `$watch`} expressions on the scope. The +linking} phase the {@link api/ng.$compileProvider#methods_directive directives} set up +{@link api/ng.$rootScope.Scope#methods_$watch `$watch`} expressions on the scope. The `$watch` allows the directives to be notified of property changes, which allows the directive to render the updated value to the DOM. @@ -182,8 +182,8 @@ To examine the scope in the debugger: ## Scope Events Propagation Scopes can propagate events in similar fashion to DOM events. The event can be {@link -api/ng.$rootScope.Scope#$broadcast broadcasted} to the scope children or {@link -api/ng.$rootScope.Scope#$emit emitted} to scope parents. +api/ng.$rootScope.Scope#methods_$broadcast broadcasted} to the scope children or {@link +api/ng.$rootScope.Scope#methods_$emit emitted} to scope parents. <example> <file name="script.js"> @@ -225,14 +225,14 @@ more events. When the browser calls into JavaScript the code executes outside the Angular execution context, which means that Angular is unaware of model modifications. To properly process model modifications the execution has to enter the Angular execution context using the {@link -api/ng.$rootScope.Scope#$apply `$apply`} method. Only model modifications which +api/ng.$rootScope.Scope#methods_$apply `$apply`} method. Only model modifications which execute inside the `$apply` method will be properly accounted for by Angular. For example if a directive listens on DOM events, such as {@link api/ng.directive:ngClick `ng-click`} it must evaluate the expression inside the `$apply` method. After evaluating the expression, the `$apply` method performs a {@link -api/ng.$rootScope.Scope#$digest `$digest`}. In the $digest phase the scope examines all +api/ng.$rootScope.Scope#methods_$digest `$digest`}. In the $digest phase the scope examines all of the `$watch` expressions and compares them with the previous value. This dirty checking is done asynchronously. This means that assignment such as `$scope.username="angular"` will not immediately cause a `$watch` to be notified, instead the `$watch` notification is delayed until @@ -250,20 +250,20 @@ the `$digest` phase. This delay is desirable, since it coalesces multiple model 2. **Watcher registration** During template linking directives register {@link - api/ng.$rootScope.Scope#$watch watches} on the scope. These watches will be + api/ng.$rootScope.Scope#methods_$watch watches} on the scope. These watches will be used to propagate model values to the DOM. 3. **Model mutation** For mutations to be properly observed, you should make them only within the {@link - api/ng.$rootScope.Scope#$apply scope.$apply()}. (Angular APIs do this + api/ng.$rootScope.Scope#methods_$apply scope.$apply()}. (Angular APIs do this implicitly, so no extra `$apply` call is needed when doing synchronous work in controllers, or asynchronous work with {@link api/ng.$http $http} or {@link api/ng.$timeout $timeout} services. 4. **Mutation observation** - At the end `$apply`, Angular performs a {@link api/ng.$rootScope.Scope#$digest + At the end `$apply`, Angular performs a {@link api/ng.$rootScope.Scope#methods_$digest $digest} cycle on the root scope, which then propagates throughout all child scopes. During the `$digest` cycle, all `$watch`ed expressions or functions are checked for model mutation and if a mutation is detected, the `$watch` listener is called. @@ -271,7 +271,7 @@ the `$digest` phase. This delay is desirable, since it coalesces multiple model 5. **Scope destruction** When child scopes are no longer needed, it is the responsibility of the child scope creator - to destroy them via {@link api/ng.$rootScope.Scope#$destroy scope.$destroy()} + to destroy them via {@link api/ng.$rootScope.Scope#methods_$destroy scope.$destroy()} API. This will stop propagation of `$digest` calls into the child scope and allow for memory used by the child scope models to be reclaimed by the garbage collector. @@ -279,27 +279,27 @@ the `$digest` phase. This delay is desirable, since it coalesces multiple model ### Scopes and Directives During the compilation phase, the {@link compiler compiler} matches {@link -api/ng.$compileProvider#directive directives} against the DOM template. The directives +api/ng.$compileProvider#methods_directive directives} against the DOM template. The directives usually fall into one of two categories: - - Observing {@link api/ng.$compileProvider#directive directives}, such as + - Observing {@link api/ng.$compileProvider#methods_directive directives}, such as double-curly expressions `{{expression}}`, register listeners using the {@link - api/ng.$rootScope.Scope#$watch $watch()} method. This type of directive needs + api/ng.$rootScope.Scope#methods_$watch $watch()} method. This type of directive needs to be notified whenever the expression changes so that it can update the view. - Listener directives, such as {@link api/ng.directive:ngClick ng-click}, register a listener with the DOM. When the DOM listener fires, the directive executes the associated expression and updates the view using the {@link - api/ng.$rootScope.Scope#$apply $apply()} method. + api/ng.$rootScope.Scope#methods_$apply $apply()} method. When an external event (such as a user action, timer or XHR) is received, the associated {@link expression expression} must be applied to the scope through the {@link -api/ng.$rootScope.Scope#$apply $apply()} method so that all listeners are updated +api/ng.$rootScope.Scope#methods_$apply $apply()} method so that all listeners are updated correctly. ### Directives that Create Scopes -In most cases, {@link api/ng.$compileProvider#directive directives} and scopes interact +In most cases, {@link api/ng.$compileProvider#methods_directive directives} and scopes interact but do not create new instances of scope. However, some directives, such as {@link api/ng.directive:ngController ng-controller} and {@link api/ng.directive:ngRepeat ng-repeat}, create new child scopes @@ -315,7 +315,7 @@ Scopes and controllers interact with each other in the following situations: - Controllers define methods (behavior) that can mutate the model (properties on the scope). - - Controllers may register {@link api/ng.$rootScope.Scope#$watch watches} on + - Controllers may register {@link api/ng.$rootScope.Scope#methods_$watch watches} on the model. These watches execute immediately after the controller behavior executes. See the {@link api/ng.directive:ngController ng-controller} for more |
