mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
doc(guide): clean up broken links
This commit is contained in:
@@ -49,14 +49,14 @@ initialization.
|
||||
# Automatic Initialization
|
||||
|
||||
Angular initializes automatically upon `DOMContentLoaded` event, at which point angular looks for
|
||||
the {@link api/angular.module.ng.$compileProvider.directive.ng:app `ng-app`} directive which
|
||||
the {@link api/angular.module.ng.$compileProvider.directive.ngApp `ng-app`} directive which
|
||||
designates your application root. If {@link
|
||||
api/angular.module.ng.$compileProvider.directive.ng:app `ng-app`} directive is found then Angular
|
||||
will:
|
||||
|
||||
* load the {@link guide/module module} associated with the directive.
|
||||
* create the application {@link api/angular.module.AUTO.$injector injector}
|
||||
* compile the DOM treating the {@link api/angular.module.ng.$compileProvider.directive.ng:app
|
||||
* compile the DOM treating the {@link api/angular.module.ng.$compileProvider.directive.ngApp
|
||||
`ng-app`} directive as the root of the compilation. This allows you to tell it to treat only a
|
||||
portion of the DOM as an Angular application.
|
||||
|
||||
@@ -82,7 +82,7 @@ or the need to perform an operation before the Angular compiles a page.
|
||||
|
||||
|
||||
Here is an example of manually initializing Angular. The example is equivalent to using the {@link
|
||||
api/angular.module.ng.$compileProvider.directive.ng:app ng:app} directive.
|
||||
api/angular.module.ng.$compileProvider.directive.ngApp ng-app} directive.
|
||||
|
||||
<pre>
|
||||
<!doctype html>
|
||||
|
||||
@@ -39,7 +39,7 @@ process happens into two phases.
|
||||
scope model are reflected in the view, and any user interactions with the view are reflected
|
||||
in the scope model. Making the scope model a single source of truth.
|
||||
|
||||
Some directives such {@link api/angular.module.ng.$compileProvider.directive.ng:repeat
|
||||
Some directives such {@link api/angular.module.ng.$compileProvider.directive.ngRepeat
|
||||
`ng-repeat`} clone DOM elements once for each item in collection. Having a compile and link phase
|
||||
improves performance since the cloned template only needs to be compiled once, and then linked
|
||||
once for each clone instance.
|
||||
@@ -50,7 +50,7 @@ once for each clone instance.
|
||||
Directive is a behavior which should be triggered when specific HTML constructs are encountered in
|
||||
compilation process. The directives can be placed in element names, attributes, class names, as
|
||||
well as comments. Here are some equivalent examples of invoking {@link
|
||||
api/angular.module.ng.$compileProvider.directive.ng:bind `ng-bind`} directive.
|
||||
api/angular.module.ng.$compileProvider.directive.ngBind `ng-bind`} directive.
|
||||
|
||||
<pre>
|
||||
<span ng-bind="exp"></span>
|
||||
|
||||
@@ -58,7 +58,7 @@ Putting any presentation logic into controllers significantly affects testabilit
|
||||
logic. Angular offers {@link dev_guide.templates.databinding} for automatic DOM manipulation. If
|
||||
you have to perform your own manual DOM manipulation, encapsulate the presentation logic in
|
||||
{@link guide/directive directives}.
|
||||
- Input formatting — Use {@link dev_guide.forms angular form controls} instead.
|
||||
- Input formatting — Use {@link forms angular form controls} instead.
|
||||
- Output filtering — Use {@link dev_guide.templates.filters angular filters} instead.
|
||||
- Run stateless or stateful code shared across controllers — Use {@link dev_guide.services angular
|
||||
services} instead.
|
||||
|
||||
@@ -26,7 +26,7 @@ occurs in controllers:
|
||||
$scope.foo = 'bar';
|
||||
}
|
||||
|
||||
* Use an {@link dev_guide.expressions angular expression} with an assignment operator in templates:
|
||||
* Use an {@link expression angular expression} with an assignment operator in templates:
|
||||
|
||||
<button ng-click="{{foos='ball'}}">Click me</button>
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ create this instance when called.
|
||||
# Dependencies
|
||||
|
||||
Services can not only be depended upon, but also have its own dependencies. These can be specified
|
||||
as arguments of the factory function. {@link di.understanding_di Read more} about the DI
|
||||
as arguments of the factory function. {@link di Read more} about the DI
|
||||
in Angular and the use of array notation and $inject property to make DI annotation
|
||||
minification-proof.
|
||||
|
||||
|
||||
@@ -20,4 +20,4 @@ Angular sets these CSS classes. It is up to your application to provide useful s
|
||||
## Related Topics
|
||||
|
||||
* {@link dev_guide.templates Angular Templates}
|
||||
* {@link dev_guide.forms Angular Forms}
|
||||
* {@link forms Angular Forms}
|
||||
|
||||
@@ -59,7 +59,7 @@ text upper-case and assigns color.
|
||||
## Related Topics
|
||||
|
||||
* {@link dev_guide.templates.filters Understanding Angular Filters}
|
||||
* {@link dev_guide.compiler Angular HTML Compiler}
|
||||
* {@link compiler Angular HTML Compiler}
|
||||
|
||||
## Related API
|
||||
|
||||
|
||||
@@ -15,14 +15,14 @@ These are the types of angular elements and element attributes you can use in a
|
||||
* {@link api/angular.module.ng.$interpolate Markup} — The double
|
||||
curly brace notation `{{ }}` to bind expressions to elements is built-in angular markup.
|
||||
* {@link dev_guide.templates.filters Filter} — Formats your data for display to the user.
|
||||
* {@link dev_guide.forms Form controls} — Lets you validate user input.
|
||||
* {@link forms Form controls} — Lets you validate user input.
|
||||
|
||||
Note: In addition to declaring the elements above in templates, you can also access these elements
|
||||
in JavaScript code.
|
||||
|
||||
The following code snippet shows a simple angular template made up of standard HTML tags along with
|
||||
angular {@link guide/directive directives} and curly-brace bindings
|
||||
with {@link dev_guide.expressions expressions}:
|
||||
with {@link expression expressions}:
|
||||
|
||||
<pre>
|
||||
<html ng-app>
|
||||
@@ -50,7 +50,7 @@ eight.
|
||||
## Related Topics
|
||||
|
||||
* {@link dev_guide.templates.filters Angular Filters}
|
||||
* {@link dev_guide.forms Angular Forms}
|
||||
* {@link forms Angular Forms}
|
||||
|
||||
## Related API
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@ngdoc overview
|
||||
@name directive
|
||||
@name Directives
|
||||
@description
|
||||
|
||||
Directives are a way to teach HTML new tricks. During DOM compilation directives are matched
|
||||
|
||||
@@ -30,7 +30,7 @@ of the following documents before returning here to the Developer Guide:
|
||||
## {@link dev_guide.templates Angular Templates}
|
||||
|
||||
* {@link dev_guide.templates.filters Understanding Angular Filters}
|
||||
* {@link dev_guide.forms Understanding Angular Forms}
|
||||
* {@link forms Understanding Angular Forms}
|
||||
|
||||
## {@link dev_guide.services Angular Services}
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ where the `department` property is defined.
|
||||
Scopes are attached to the DOM as `$scope` data property, and can be retrieved for debugging
|
||||
purposes. (It is unlikely that one would need to retrieve scopes in this way inside the
|
||||
application.) The location where the root scope is attached to the DOM is defined by the location
|
||||
of {@link api/angular.module.ng.$compileProvider.directive.ng:app `ng-app`} directive. Typically
|
||||
of {@link api/angular.module.ng.$compileProvider.directive.ngApp `ng-app`} directive. Typically
|
||||
`ng-app` is placed an the `<html>` element, but it can be placed on other elements as well, if,
|
||||
for example, only a portion of the view needs to be controlled by angular.
|
||||
|
||||
@@ -228,7 +228,7 @@ modifications the execution has to enter the Angular execution context using the
|
||||
api/angular.module.ng.$rootScope.Scope#$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/angular.module.ng.$compileProvider.directive.ng:click `ng-click`} it must evaluate the
|
||||
api/angular.module.ng.$compileProvider.directive.ngClick `ng-click`} it must evaluate the
|
||||
expression inside the `$apply` method.
|
||||
|
||||
After evaluating the expression `$apply` method performs a {@link
|
||||
@@ -287,8 +287,8 @@ usually fall into one of two categories:
|
||||
api/angular.module.ng.$rootScope.Scope#$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/angular.module.ng.$compileProvider.directive.ng:click
|
||||
ng:click}, register a listener with the DOM. When the DOM listener fires, the directive
|
||||
- Listener directives, such as {@link api/angular.module.ng.$compileProvider.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/angular.module.ng.$rootScope.Scope#$apply $apply()} method.
|
||||
|
||||
@@ -301,8 +301,8 @@ correctly.
|
||||
|
||||
In most cases, {@link api/angular.module.ng.$compileProvider.directive directives} and scopes interact
|
||||
but do not create new instances of scope. However, some directives, such as {@link
|
||||
api/angular.module.ng.$compileProvider.directive.ng:controller ng:controller} and {@link
|
||||
api/angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat}, create new child scopes
|
||||
api/angular.module.ng.$compileProvider.directive.ngController ng-controller} and {@link
|
||||
api/angular.module.ng.$compileProvider.directive.ngRepeat ng-repeat}, create new child scopes
|
||||
and attach the child scope to the corresponding DOM element. You can retrieve a scope for any DOM
|
||||
element by using an `angular.element(aDomElement).scope()` method call.
|
||||
|
||||
@@ -311,14 +311,15 @@ element by using an `angular.element(aDomElement).scope()` method call.
|
||||
Scopes and controllers interact with each other in the following situations:
|
||||
|
||||
- Controllers use scopes to expose controller methods to templates (see {@link
|
||||
api/angular.module.ng.$compileProvider.directive.ng:controller ng:controller}).
|
||||
api/angular.module.ng.$compileProvider.directive.ngController ng-controller}).
|
||||
|
||||
- Controllers define methods (behavior) that can mutate the model (properties on the scope).
|
||||
|
||||
- Controllers may register {@link api/angular.module.ng.$rootScope.Scope#$watch watches} on
|
||||
the model. These watches execute immediately after the controller behavior executes.
|
||||
|
||||
See the {@link controller controller documentation} for more information.
|
||||
See the {@link api/angular.module.ng.$compileProvider.directive.ngController ng-controller} for more
|
||||
information.
|
||||
|
||||
|
||||
### Scope `$watch` Performance Considerations
|
||||
|
||||
Reference in New Issue
Block a user