docs(api): update for alpha-25

This commit is contained in:
Naomi Black 2015-06-02 09:05:05 -07:00
parent d62557ada6
commit b206074f27
20 changed files with 279 additions and 208 deletions

View File

@ -1,7 +1,7 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/annotations.ts#L778-L1011">angular2/src/core/annotations_impl/annotations.ts (line 778)</a>
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/annotations.ts#L776-L1009">angular2/src/core/annotations_impl/annotations.ts (line 776)</a>
:markdown
Declare reusable UI building blocks for an application.

View File

@ -1,7 +1,7 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/annotations.ts#L4-L778">angular2/src/core/annotations_impl/annotations.ts (line 4)</a>
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/annotations.ts#L4-L776">angular2/src/core/annotations_impl/annotations.ts (line 4)</a>
:markdown
Directives allow you to attach behavior to elements in the DOM.
@ -211,11 +211,10 @@ p.location-badge.
A directive can also query for other child directives. Since parent directives are instantiated
before child
directives, a directive can't simply inject the list of child directives. Instead, the directive
injects a <a href='../core/QueryList-class.html'><code>QueryList</code></a>, which updates its contents as children are added, removed, or moved
by a directive
that uses a <a href='../core/ViewContainerRef-class.html'><code>ViewContainerRef</code></a> such as a `for`, an `if`, or a `switch`.
before child directives, a directive can't simply inject the list of child directives. Instead,
the directive injects a <a href='../core/QueryList-class.html'><code>QueryList</code></a>, which updates its contents as children are added,
removed, or moved by a directive that uses a <a href='../core/ViewContainerRef-class.html'><code>ViewContainerRef</code></a> such as a `ng-for`, an
`ng-if`, or an `ng-switch`.
```
@Directive({ selector: '[my-directive]' })
@ -226,8 +225,7 @@ p.location-badge.
```
This directive would be instantiated with a <a href='../core/QueryList-class.html'><code>QueryList</code></a> which contains `Dependency` 4 and
6. Here, `Dependency`
5 would not be included, because it is not a direct child.
6. Here, `Dependency` 5 would not be included, because it is not a direct child.
### Injecting a live collection of descendant directives
@ -704,7 +702,8 @@ p.location-badge.
Specifies a set of lifecycle hostListeners in which the directive participates.
See <a href='annotations/onChange'>onChange</a>, <a href='annotations/onDestroy'>onDestroy</a>, <a href='annotations/onAllChangesDone'>onAllChangesDone</a> for details.
See <a href='annotations/onChange'>onChange</a>, <a href='annotations/onDestroy'>onDestroy</a>,
<a href='annotations/onAllChangesDone'>onAllChangesDone</a> for details.

View File

@ -1,12 +1,15 @@
<h1>onAllChangesDone</h1>
<h2>(const)</h2>
<div>
<p>Notify a directive when the bindings of all its children have been changed.</p>
.l-main-section
h2 Example:
pre(class="prettyprint linenums")
code.
h2 onAllChangesDone <span class="type">variable</span>
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
:markdown
Notify a directive when the bindings of all its children have been changed.
## Example:
```
@Directive({
selector: '[class-set]',
lifecycle: [onAllChangesDone]
@ -17,4 +20,5 @@ class ClassSet {
}
}
</div>
```

View File

@ -1,15 +1,20 @@
<h1>onChange</h1>
<h2>(const)</h2>
<div>
<p>Notify a directive when any of its bindings have changed.</p>
<p>This method is called right after the directive&#39;s bindings have been checked,
and before any of its children&#39;s bindings have been checked.</p>
<p>It is invoked only if at least one of the directive&#39;s bindings has changed.</p>
.l-main-section
h2 Example:
pre(class="prettyprint linenums")
code.
h2 onChange <span class="type">variable</span>
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
:markdown
Notify a directive when any of its bindings have changed.
This method is called right after the directive's bindings have been checked,
and before any of its children's bindings have been checked.
It is invoked only if at least one of the directive's bindings has changed.
## Example:
```
@Directive({
selector: '[class-set]',
properties: [
@ -31,4 +36,5 @@ class ClassSet {
}
}
}
</div>
```

View File

@ -1,15 +1,20 @@
<h1>onCheck</h1>
<h2>(const)</h2>
<div>
<p>Notify a directive when it has been checked.</p>
<p>This method is called right after the directive&#39;s bindings have been checked,
and before any of its children&#39;s bindings have been checked.</p>
<p>It is invoked every time even when none of the directive&#39;s bindings has changed.</p>
.l-main-section
h2 Example:
pre(class="prettyprint linenums")
code.
h2 onCheck <span class="type">variable</span>
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
:markdown
Notify a directive when it has been checked.
This method is called right after the directive's bindings have been checked,
and before any of its children's bindings have been checked.
It is invoked every time even when none of the directive's bindings has changed.
## Example:
```
@Directive({
selector: '[class-set]',
lifecycle: [onCheck]
@ -18,4 +23,5 @@ class ClassSet {
onCheck() {
}
}
</div>
```

View File

@ -1,12 +1,15 @@
<h1>onDestroy</h1>
<h2>(const)</h2>
<div>
<p>Notify a directive whenever a <a href='View-var.html'><code>View</code></a> that contains it is destroyed.</p>
.l-main-section
h2 Example
pre(class="prettyprint linenums")
code.
h2 onDestroy <span class="type">variable</span>
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
:markdown
Notify a directive whenever a <a href='View-var.html'><code>View</code></a> that contains it is destroyed.
## Example
```
@Directive({
...,
lifecycle: [onDestroy]
@ -16,4 +19,5 @@ class ClassSet {
// invoked to notify directive of the containing view destruction.
}
}
</div>
```

View File

@ -1,15 +1,20 @@
<h1>onInit</h1>
<h2>(const)</h2>
<div>
<p>Notify a directive when it has been checked the first itme.</p>
<p>This method is called right after the directive&#39;s bindings have been checked,
and before any of its children&#39;s bindings have been checked.</p>
<p>It is invoked only once.</p>
.l-main-section
h2 Example:
pre(class="prettyprint linenums")
code.
h2 onInit <span class="type">variable</span>
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
:markdown
Notify a directive when it has been checked the first itme.
This method is called right after the directive's bindings have been checked,
and before any of its children's bindings have been checked.
It is invoked only once.
## Example:
```
@Directive({
selector: '[class-set]',
lifecycle: [onInit]
@ -18,4 +23,5 @@ class ClassSet {
onInit() {
}
}
</div>
```

View File

@ -1,8 +1,12 @@
<h1>CHECKED</h1>
<h2>(const)</h2>
<div>
<p>CHECKED means that the change detector should be skipped until its mode changes to
CHECK_ONCE or CHECK_ALWAYS.</p>
.l-main-section
h2 CHECKED <span class="type">variable</span>
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
:markdown
CHECKED means that the change detector should be skipped until its mode changes to
CHECK_ONCE or CHECK_ALWAYS.
</div>

View File

@ -1,8 +1,12 @@
<h1>CHECK_ALWAYS</h1>
<h2>(const)</h2>
<div>
<p>CHECK_ALWAYS means that after calling detectChanges the mode of the change detector
will remain CHECK_ALWAYS.</p>
.l-main-section
h2 CHECK_ALWAYS <span class="type">variable</span>
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
:markdown
CHECK_ALWAYS means that after calling detectChanges the mode of the change detector
will remain CHECK_ALWAYS.
</div>

View File

@ -1,8 +1,12 @@
<h1>CHECK_ONCE</h1>
<h2>(const)</h2>
<div>
<p>CHECK_ONCE means that after calling detectChanges the mode of the change detector
will become CHECKED.</p>
.l-main-section
h2 CHECK_ONCE <span class="type">variable</span>
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
:markdown
CHECK_ONCE means that after calling detectChanges the mode of the change detector
will become CHECKED.
</div>

View File

@ -1,7 +1,11 @@
<h1>DEFAULT</h1>
<h2>(const)</h2>
<div>
<p>DEFAULT means that the change detector&#39;s mode will be set to CHECK_ALWAYS during hydration.</p>
.l-main-section
h2 DEFAULT <span class="type">variable</span>
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
:markdown
DEFAULT means that the change detector's mode will be set to CHECK_ALWAYS during hydration.
</div>

View File

@ -1,8 +1,12 @@
<h1>DETACHED</h1>
<h2>(const)</h2>
<div>
<p>DETACHED means that the change detector sub tree is not a part of the main tree and
should be skipped.</p>
.l-main-section
h2 DETACHED <span class="type">variable</span>
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
:markdown
DETACHED means that the change detector sub tree is not a part of the main tree and
should be skipped.
</div>

View File

@ -1,7 +1,11 @@
<h1>ON_PUSH</h1>
<h2>(const)</h2>
<div>
<p>ON_PUSH means that the change detector&#39;s mode will be set to CHECK_ONCE during hydration.</p>
.l-main-section
h2 ON_PUSH <span class="type">variable</span>
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
:markdown
ON_PUSH means that the change detector's mode will be set to CHECK_ONCE during hydration.
</div>

View File

@ -1,14 +1,13 @@
p.location-badge.
exported from <a href='../directives'>angular2/directives</a>
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/directives/ng_if.ts#L3-L51">angular2/src/directives/ng_if.ts (line 3)</a>
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/directives/ng_if.ts#L3-L50">angular2/src/directives/ng_if.ts (line 3)</a>
:markdown
Removes or recreates a portion of the DOM tree based on an {expression}.
If the expression assigned to `if` evaluates to a false value then the element is removed from
the
DOM, otherwise a clone of the element is reinserted into the DOM.
If the expression assigned to `ng-if` evaluates to a false value then the element
is removed from the DOM, otherwise a clone of the element is reinserted into the DOM.
# Example:

View File

@ -6,7 +6,7 @@ p.location-badge.
:markdown
Defines a default case statement.
Default case statements are displayed when no `NgSwitchWhen` match the `switch` value.
Default case statements are displayed when no `NgSwitchWhen` match the `ng-switch` value.
Example:

View File

@ -1,14 +1,18 @@
<h1>coreDirectives</h1>
<h2>(const)</h2>
<div>
<p>A collection of the Angular core directives that are likely to be used in each and every Angular
application.</p>
<p>This collection can be used to quickly enumerate all the built-in directives in the <code>@View</code>
.l-main-section
h2 coreDirectives <span class="type">variable</span>
p.location-badge.
exported from <a href='../directives'>angular2/directives</a>
:markdown
A collection of the Angular core directives that are likely to be used in each and every Angular
application.
This collection can be used to quickly enumerate all the built-in directives in the `@View`
annotation. For example,
instead of writing:</p>
pre(class="prettyprint linenums")
code.
instead of writing:
```
import {If, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/angular2';
import {OtherDirective} from 'myDirectives';
@ -21,9 +25,11 @@ import {OtherDirective} from 'myDirectives';
})
export class MyComponent {
...
}<p>one could enumerate all the core directives at once:</p>
pre(class="prettyprint linenums")
code.
}
```
one could enumerate all the core directives at once:
```
import {coreDirectives} from 'angular2/angular2';
import {OtherDirective} from 'myDirectives';
@ -37,4 +43,7 @@ import {OtherDirective} from 'myDirectives';
export class MyComponent {
...
}
</div>
```

View File

@ -1,7 +1,10 @@
<h1>INVALID</h1>
<h2>(const)</h2>
<div>
<p>Indicates that a Control is invalid, i.e. that an error exists in the input value.</p>
.l-main-section
h2 INVALID <span class="type">variable</span>
p.location-badge.
exported from <a href='../forms'>angular2/forms</a>
:markdown
Indicates that a Control is invalid, i.e. that an error exists in the input value.
</div>

View File

@ -1,7 +1,10 @@
<h1>VALID</h1>
<h2>(const)</h2>
<div>
<p>Indicates that a Control is valid, i.e. that no errors exist in the input value.</p>
.l-main-section
h2 VALID <span class="type">variable</span>
p.location-badge.
exported from <a href='../forms'>angular2/forms</a>
:markdown
Indicates that a Control is valid, i.e. that no errors exist in the input value.
</div>

View File

@ -1,8 +1,12 @@
<h1>formDirectives</h1>
<h2>(const)</h2>
<div>
<p>A list of all the form directives used as part of a <code>@View</code> annotation.</p>
<p> This is a shorthand for importing them each individually.</p>
.l-main-section
h2 formDirectives <span class="type">variable</span>
p.location-badge.
exported from <a href='../forms'>angular2/forms</a>
:markdown
A list of all the form directives used as part of a `@View` annotation.
This is a shorthand for importing them each individually.
</div>

View File

@ -1,6 +1,10 @@
<h1>routerDirectives</h1>
<h2>(const)</h2>
<div>
.l-main-section
h2 routerDirectives <span class="type">variable</span>
p.location-badge.
exported from <a href='../router'>angular2/router</a>
:markdown
</div>