docs(api): updates for alpha-27 (plus a few interim additions pre-28)
This commit is contained in:
parent
69c45dfa99
commit
af8c852edb
|
@ -1,72 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/visibility.js#L105">angular2/src/core/annotations_impl/visibility.js (line 105)</a>
|
||||
|
||||
:markdown
|
||||
Specifies that an injector should retrieve a dependency from any ancestor element.
|
||||
|
||||
An ancestor is any element between the parent element and shadow root.
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
Here is a simple directive that retrieves a dependency from an ancestor element.
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: '[dependency]',
|
||||
properties: {
|
||||
'id':'dependency'
|
||||
}
|
||||
})
|
||||
class Dependency {
|
||||
id:string;
|
||||
}
|
||||
|
||||
|
||||
@Directive({
|
||||
selector: '[my-directive]'
|
||||
})
|
||||
class Dependency {
|
||||
constructor(@Ancestor() dependency:Dependency) {
|
||||
expect(dependency.id).toEqual(2);
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
We use this with the following HTML template:
|
||||
|
||||
```
|
||||
<div dependency="1">
|
||||
<div dependency="2">
|
||||
<div>
|
||||
<div dependency="3" my-directive></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
The `@Ancestor()` annotation in our constructor forces the injector to retrieve the dependency from the
|
||||
nearest ancestor element:
|
||||
- The current element `dependency="3"` is skipped because it is not an ancestor.
|
||||
- Next parent has no directives `<div>`
|
||||
- Next parent has the `Dependency` directive and so the dependency is satisfied.
|
||||
|
||||
Angular injects `dependency=2`.
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
h2 Ancestor <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L52-L52">angular2/src/core/annotations/decorators.ts (line 52)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/di.js#L31">angular2/src/core/annotations_impl/di.js (line 31)</a>
|
||||
|
||||
:markdown
|
||||
Specifies that a constant attribute value should be injected.
|
||||
|
||||
The directive can inject constant string literals of host element attributes.
|
||||
|
||||
## Example
|
||||
|
||||
Suppose we have an `<input>` element and want to know its `type`.
|
||||
|
||||
```html
|
||||
<input type="text">
|
||||
```
|
||||
|
||||
A decorator can inject string literal `text` like so:
|
||||
|
||||
```javascript
|
||||
@Directive({
|
||||
selector: `input'
|
||||
})
|
||||
class InputDirective {
|
||||
constructor(@Attribute('type') type) {
|
||||
// type would be `text` in this example
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(attributeName)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 attributeName
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 token
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
h2 Attribute <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L56-L56">angular2/src/core/annotations/decorators.ts (line 56)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,191 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/annotations.js#L732">angular2/src/core/annotations_impl/annotations.js (line 732)</a>
|
||||
|
||||
:markdown
|
||||
Declare reusable UI building blocks for an application.
|
||||
|
||||
Each Angular component requires a single `@Component` and at least one `@View` annotation. The `@Component`
|
||||
annotation specifies when a component is instantiated, and which properties and hostListeners it binds to.
|
||||
|
||||
When a component is instantiated, Angular
|
||||
- creates a shadow DOM for the component.
|
||||
- loads the selected template into the shadow DOM.
|
||||
- creates a child <a href='../di/Injector-class.html'><code>Injector</code></a> which is configured with the `injectables` for the <a href='Component-class.html'><code>Component</code></a>.
|
||||
|
||||
All template expressions and statements are then evaluated against the component instance.
|
||||
|
||||
For details on the `@View` annotation, see <a href='View-class.html'><code>View</code></a>.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component({
|
||||
selector: 'greet'
|
||||
})
|
||||
@View({
|
||||
template: 'Hello {{name}}!'
|
||||
})
|
||||
class Greet {
|
||||
name: string;
|
||||
|
||||
constructor() {
|
||||
this.name = 'World';
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Dynamically loading a component at runtime:
|
||||
|
||||
Regular Angular components are statically resolved. Dynamic components allows to resolve a component at runtime
|
||||
instead by providing a placeholder into which a regular Angular component can be dynamically loaded. Once loaded,
|
||||
the dynamically-loaded component becomes permanent and cannot be changed.
|
||||
Dynamic components are declared just like components, but without a `@View` annotation.
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
Here we have `DynamicComp` which acts as the placeholder for `HelloCmp`. At runtime, the dynamic component
|
||||
`DynamicComp` requests loading of the `HelloCmp` component.
|
||||
|
||||
There is nothing special about `HelloCmp`, which is a regular Angular component. It can also be used in other static
|
||||
locations.
|
||||
|
||||
```
|
||||
@Component({
|
||||
selector: 'dynamic-comp'
|
||||
})
|
||||
class DynamicComp {
|
||||
helloCmp:HelloCmp;
|
||||
constructor(loader:DynamicComponentLoader, location:ElementRef) {
|
||||
loader.load(HelloCmp, location).then((helloCmp) => {
|
||||
this.helloCmp = helloCmp;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'hello-cmp'
|
||||
})
|
||||
@View({
|
||||
template: "{{greeting}}"
|
||||
})
|
||||
class HelloCmp {
|
||||
greeting:string;
|
||||
constructor() {
|
||||
this.greeting = "hello";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor({
|
||||
selector,
|
||||
properties,
|
||||
events,
|
||||
hostListeners,
|
||||
hostProperties,
|
||||
injectables,
|
||||
lifecycle,
|
||||
changeDetection = DEFAULT,
|
||||
compileChildren = true,
|
||||
}:{
|
||||
selector:string,
|
||||
properties:Object,
|
||||
events:List,
|
||||
hostListeners:any,
|
||||
hostProperties:any,
|
||||
injectables:List,
|
||||
lifecycle:List,
|
||||
changeDetection:string,
|
||||
compileChildren:boolean
|
||||
}={})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 changeDetection
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Defines the used change detection strategy.
|
||||
|
||||
When a component is instantiated, Angular creates a change detector, which is responsible for propagating
|
||||
the component's bindings.
|
||||
|
||||
The `changeDetection` property defines, whether the change detection will be checked every time or only when the component
|
||||
tells it to do so.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 injectables
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Defines the set of injectable objects that are visible to a Component and its children.
|
||||
|
||||
The `injectables` defined in the Component annotation allow you to configure a set of bindings for the component's
|
||||
injector.
|
||||
|
||||
When a component is instantiated, Angular creates a new child Injector, which is configured with the bindings in
|
||||
the Component `injectables` annotation. The injectable objects then become available for injection to the component
|
||||
itself and any of the directives in the component's template, i.e. they are not available to the directives which
|
||||
are children in the component's light DOM.
|
||||
|
||||
|
||||
The syntax for configuring the `injectables` injectable is identical to <a href='../di/Injector-class.html'><code>Injector</code></a> injectable configuration.
|
||||
See <a href='../di/Injector-class.html'><code>Injector</code></a> for additional detail.
|
||||
|
||||
|
||||
## Simple Example
|
||||
|
||||
Here is an example of a class that can be injected:
|
||||
|
||||
```
|
||||
class Greeter {
|
||||
greet(name:string) {
|
||||
return 'Hello ' + name + '!';
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'greet',
|
||||
injectables: [
|
||||
Greeter
|
||||
]
|
||||
})
|
||||
@View({
|
||||
template: `{{greeter.greet('world')}}!`,
|
||||
directives: Child
|
||||
})
|
||||
class HelloWorld {
|
||||
greeter:Greeter;
|
||||
|
||||
constructor(greeter:Greeter) {
|
||||
this.greeter = greeter;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
@ -3,8 +3,10 @@
|
|||
h2 Component <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L43-L43">angular2/src/core/annotations/decorators.ts (line 43)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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#L776-L1009">angular2/src/core/annotations_impl/annotations.ts (line 776)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/annotations.ts#L812-L981">angular2/src/core/annotations_impl/annotations.ts (line 812)</a>
|
||||
|
||||
:markdown
|
||||
Declare reusable UI building blocks for an application.
|
||||
|
@ -40,54 +40,6 @@ p.location-badge.
|
|||
```
|
||||
|
||||
|
||||
Dynamically loading a component at runtime:
|
||||
|
||||
Regular Angular components are statically resolved. Dynamic components allows to resolve a
|
||||
component at runtime
|
||||
instead by providing a placeholder into which a regular Angular component can be dynamically
|
||||
loaded. Once loaded,
|
||||
the dynamically-loaded component becomes permanent and cannot be changed.
|
||||
Dynamic components are declared just like components, but without a `@View` annotation.
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
Here we have `DynamicComp` which acts as the placeholder for `HelloCmp`. At runtime, the dynamic
|
||||
component
|
||||
`DynamicComp` requests loading of the `HelloCmp` component.
|
||||
|
||||
There is nothing special about `HelloCmp`, which is a regular Angular component. It can also be
|
||||
used in other static
|
||||
locations.
|
||||
|
||||
```
|
||||
@Component({
|
||||
selector: 'dynamic-comp'
|
||||
})
|
||||
class DynamicComp {
|
||||
helloCmp:HelloCmp;
|
||||
constructor(loader:DynamicComponentLoader, location:ElementRef) {
|
||||
loader.load(HelloCmp, location).then((helloCmp) => {
|
||||
this.helloCmp = helloCmp;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'hello-cmp'
|
||||
})
|
||||
@View({
|
||||
template: "{{greeting}}"
|
||||
})
|
||||
class HelloCmp {
|
||||
greeting:string;
|
||||
constructor() {
|
||||
this.greeting = "hello";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
|
@ -96,23 +48,9 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor({selector, properties, events, hostListeners, hostProperties, hostAttributes,
|
||||
hostActions, appInjector, lifecycle, hostInjector, viewInjector,
|
||||
changeDetection = DEFAULT, compileChildren = true}: {
|
||||
selector?: string,
|
||||
properties?: List<string>,
|
||||
events?: List<string>,
|
||||
hostListeners?: StringMap<string, string>,
|
||||
hostProperties?: StringMap<string, string>,
|
||||
hostAttributes?: StringMap<string, string>,
|
||||
hostActions?: StringMap<string, string>,
|
||||
appInjector?: List<any>,
|
||||
lifecycle?: List<LifecycleEvent>,
|
||||
hostInjector?: List<any>,
|
||||
viewInjector?: List<any>,
|
||||
changeDetection?: string,
|
||||
compileChildren?: boolean
|
||||
} = {})
|
||||
constructor({selector, properties, events, host, exportAs, appInjector, lifecycle, hostInjector,
|
||||
viewInjector, changeDetection = DEFAULT,
|
||||
compileChildren = true}?: ComponentArgs)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -121,6 +59,28 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 changeDetection
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Defines the used change detection strategy.
|
||||
|
||||
When a component is instantiated, Angular creates a change detector, which is responsible for
|
||||
propagating
|
||||
the component's bindings.
|
||||
|
||||
The `changeDetection` property defines, whether the change detection will be checked every time
|
||||
or only when the component
|
||||
tells it to do so.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 appInjector
|
||||
|
||||
|
@ -183,28 +143,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 changeDetection
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Defines the used change detection strategy.
|
||||
|
||||
When a component is instantiated, Angular creates a change detector, which is responsible for
|
||||
propagating
|
||||
the component's bindings.
|
||||
|
||||
The `changeDetection` property defines, whether the change detection will be checked every time
|
||||
or only when the component
|
||||
tells it to do so.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 viewInjector
|
||||
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/annotations.ts#L981-L987">angular2/src/core/annotations_impl/annotations.ts (line 981)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 appInjector
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 viewInjector
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 changeDetection
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L18-L22">angular2/src/core/annotations/decorators.ts (line 18)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 View
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
View(obj: ViewArgs)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,701 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/annotations.js#L371">angular2/src/core/annotations_impl/annotations.js (line 371)</a>
|
||||
|
||||
:markdown
|
||||
Directives allow you to attach behavior to elements in the DOM.
|
||||
|
||||
<a href='Directive-class.html'><code>Directive</code></a>s with an embedded view are called <a href='Component-class.html'><code>Component</code></a>s.
|
||||
|
||||
A directive consists of a single directive annotation and a controller class. When the directive's `selector` matches
|
||||
elements in the DOM, the following steps occur:
|
||||
|
||||
1. For each directive, the `ElementInjector` attempts to resolve the directive's constructor arguments.
|
||||
2. Angular instantiates directives for each matched element using `ElementInjector` in a depth-first order,
|
||||
as declared in the HTML.
|
||||
|
||||
## Understanding How Injection Works
|
||||
|
||||
There are three stages of injection resolution.
|
||||
- *Pre-existing Injectors*:
|
||||
- The terminal <a href='../di/Injector-class.html'><code>Injector</code></a> cannot resolve dependencies. It either throws an error or, if the dependency was
|
||||
specified as `@Optional`, returns `null`.
|
||||
- The platform injector resolves browser singleton resources, such as: cookies, title, location, and others.
|
||||
- *Component Injectors*: Each `@Component` has its own <a href='../di/Injector-class.html'><code>Injector</code></a>, and they follow the same parent-child hierarchy
|
||||
as the components in the DOM.
|
||||
- *Element Injectors*: Each component has a Shadow DOM. Within the Shadow DOM each element has an `ElementInjector`
|
||||
which follow the same parent-child hierarchy as the DOM elements themselves.
|
||||
|
||||
When a template is instantiated, it also must instantiate the corresponding directives in a depth-first order. The
|
||||
current `ElementInjector` resolves the constructor dependencies for each directive.
|
||||
|
||||
Angular then resolves dependencies as follows, according to the order in which they appear in the <a href='View-class.html'><code>View</code></a>:
|
||||
|
||||
1. Dependencies on the current element
|
||||
2. Dependencies on element injectors and their parents until it encounters a Shadow DOM boundary
|
||||
3. Dependencies on component injectors and their parents until it encounters the root component
|
||||
4. Dependencies on pre-existing injectors
|
||||
|
||||
|
||||
The `ElementInjector` can inject other directives, element-specific special objects, or it can delegate to the parent
|
||||
injector.
|
||||
|
||||
To inject other directives, declare the constructor parameter as:
|
||||
- `directive:DirectiveType`: a directive on the current element only
|
||||
- `@Ancestor() directive:DirectiveType`: any directive that matches the type between the current element and the
|
||||
Shadow DOM root. Current element is not included in the resolution, therefore even if it could resolve it, it will
|
||||
be ignored.
|
||||
- `@Parent() directive:DirectiveType`: any directive that matches the type on a direct parent element only.
|
||||
- `@Children query:Query<DirectiveType>`: A live collection of direct child directives (will be implemented in later release).
|
||||
- `@Descendants query:Query<DirectiveType>`: A live collection of any child directives (will be implemented in later relaese).
|
||||
|
||||
To inject element-specific special objects, declare the constructor parameter as:
|
||||
- `element: ElementRef` to obtain a reference to logical element in the view.
|
||||
- `viewContainer: ViewContainerRef` to control child template instantiation, for <a href='Directive-class.html'><code>Directive</code></a> directives only
|
||||
- `bindingPropagation: BindingPropagation` to control change detection in a more granular way.
|
||||
|
||||
## Example
|
||||
|
||||
The following example demonstrates how dependency injection resolves constructor arguments in practice.
|
||||
|
||||
|
||||
Assume this HTML template:
|
||||
|
||||
```
|
||||
<div dependency="1">
|
||||
<div dependency="2">
|
||||
<div dependency="3" my-directive>
|
||||
<div dependency="4">
|
||||
<div dependency="5"></div>
|
||||
</div>
|
||||
<div dependency="6"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
With the following `dependency` decorator and `SomeService` injectable class.
|
||||
|
||||
```
|
||||
@Injectable()
|
||||
class SomeService {
|
||||
}
|
||||
|
||||
@Directive({
|
||||
selector: '[dependency]',
|
||||
properties: {
|
||||
'id':'dependency'
|
||||
}
|
||||
})
|
||||
class Dependency {
|
||||
id:string;
|
||||
}
|
||||
```
|
||||
|
||||
Let's step through the different ways in which `MyDirective` could be declared...
|
||||
|
||||
|
||||
### No injection
|
||||
|
||||
Here the constructor is declared with no arguments, therefore nothing is injected into `MyDirective`.
|
||||
|
||||
```
|
||||
@Directive({ selector: '[my-directive]' })
|
||||
class MyDirective {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This directive would be instantiated with no dependencies.
|
||||
|
||||
|
||||
### Component-level injection
|
||||
|
||||
Directives can inject any injectable instance from the closest component injector or any of its parents.
|
||||
|
||||
Here, the constructor declares a parameter, `someService`, and injects the `SomeService` type from the parent
|
||||
component's injector.
|
||||
```
|
||||
@Directive({ selector: '[my-directive]' })
|
||||
class MyDirective {
|
||||
constructor(someService: SomeService) {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This directive would be instantiated with a dependency on `SomeService`.
|
||||
|
||||
|
||||
### Injecting a directive from the current element
|
||||
|
||||
Directives can inject other directives declared on the current element.
|
||||
|
||||
```
|
||||
@Directive({ selector: '[my-directive]' })
|
||||
class MyDirective {
|
||||
constructor(dependency: Dependency) {
|
||||
expect(dependency.id).toEqual(3);
|
||||
}
|
||||
}
|
||||
```
|
||||
This directive would be instantiated with `Dependency` declared at the same element, in this case `dependency="3"`.
|
||||
|
||||
|
||||
### Injecting a directive from a direct parent element
|
||||
|
||||
Directives can inject other directives declared on a direct parent element. By definition, a directive with a
|
||||
`@Parent` annotation does not attempt to resolve dependencies for the current element, even if this would satisfy
|
||||
the dependency.
|
||||
|
||||
```
|
||||
@Directive({ selector: '[my-directive]' })
|
||||
class MyDirective {
|
||||
constructor(@Parent() dependency: Dependency) {
|
||||
expect(dependency.id).toEqual(2);
|
||||
}
|
||||
}
|
||||
```
|
||||
This directive would be instantiated with `Dependency` declared at the parent element, in this case `dependency="2"`.
|
||||
|
||||
|
||||
### Injecting a directive from any ancestor elements
|
||||
|
||||
Directives can inject other directives declared on any ancestor element (in the current Shadow DOM), i.e. on the
|
||||
parent element and its parents. By definition, a directive with an `@Ancestor` annotation does not attempt to
|
||||
resolve dependencies for the current element, even if this would satisfy the dependency.
|
||||
|
||||
```
|
||||
@Directive({ selector: '[my-directive]' })
|
||||
class MyDirective {
|
||||
constructor(@Ancestor() dependency: Dependency) {
|
||||
expect(dependency.id).toEqual(2);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Unlike the `@Parent` which only checks the parent, `@Ancestor` checks the parent, as well as its
|
||||
parents recursively. If `dependency="2"` didn't exist on the direct parent, this injection would have returned
|
||||
`dependency="1"`.
|
||||
|
||||
|
||||
### Injecting a live collection of direct child directives
|
||||
|
||||
|
||||
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='../view/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`.
|
||||
|
||||
```
|
||||
@Directive({ selector: '[my-directive]' })
|
||||
class MyDirective {
|
||||
constructor(@Query(Marker) dependencies:QueryList<Maker>) {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This directive would be instantiated with a <a href='../view/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.
|
||||
|
||||
### Injecting a live collection of descendant directives
|
||||
|
||||
Note: This is will be implemented in later release. ()
|
||||
|
||||
Similar to `@Children` above, but also includes the children of the child elements.
|
||||
|
||||
```
|
||||
@Directive({ selector: '[my-directive]' })
|
||||
class MyDirective {
|
||||
constructor(@QueryDescendents(Marker) dependencies:QueryList<Maker>) {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This directive would be instantiated with a Query which would contain `Dependency` 4, 5 and 6.
|
||||
|
||||
### Optional injection
|
||||
|
||||
The normal behavior of directives is to return an error when a specified dependency cannot be resolved. If you
|
||||
would like to inject `null` on unresolved dependency instead, you can annotate that dependency with `@Optional()`.
|
||||
This explicitly permits the author of a template to treat some of the surrounding directives as optional.
|
||||
|
||||
```
|
||||
@Directive({ selector: '[my-directive]' })
|
||||
class MyDirective {
|
||||
constructor(@Optional() dependency:Dependency) {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This directive would be instantiated with a `Dependency` directive found on the current element. If none can be
|
||||
found, the injector supplies `null` instead of throwing an error.
|
||||
|
||||
## Example
|
||||
|
||||
Here we use a decorator directive to simply define basic tool-tip behavior.
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: '[tooltip]',
|
||||
properties: {
|
||||
'text': 'tooltip'
|
||||
},
|
||||
hostListeners: {
|
||||
'onmouseenter': 'onMouseEnter()',
|
||||
'onmouseleave': 'onMouseLeave()'
|
||||
}
|
||||
})
|
||||
class Tooltip{
|
||||
text:string;
|
||||
overlay:Overlay; // NOT YET IMPLEMENTED
|
||||
overlayManager:OverlayManager; // NOT YET IMPLEMENTED
|
||||
|
||||
constructor(overlayManager:OverlayManager) {
|
||||
this.overlay = overlay;
|
||||
}
|
||||
|
||||
onMouseEnter() {
|
||||
// exact signature to be determined
|
||||
this.overlay = this.overlayManager.open(text, ...);
|
||||
}
|
||||
|
||||
onMouseLeave() {
|
||||
this.overlay.close();
|
||||
this.overlay = null;
|
||||
}
|
||||
}
|
||||
```
|
||||
In our HTML template, we can then add this behavior to a `<div>` or any other element with the `tooltip` selector,
|
||||
like so:
|
||||
|
||||
```
|
||||
<div tooltip="some text here"></div>
|
||||
```
|
||||
|
||||
Directives can also control the instantiation, destruction, and positioning of inline template elements:
|
||||
|
||||
A directive uses a <a href='../core/ViewContainerRef-class.html'><code>ViewContainerRef</code></a> to instantiate, insert, move, and destroy views at runtime.
|
||||
The <a href='../core/ViewContainerRef-class.html'><code>ViewContainerRef</code></a> is created as a result of `<template>` element, and represents a location in the current view
|
||||
where these actions are performed.
|
||||
|
||||
Views are always created as children of the current <a href='View-class.html'><code>View</code></a>, and as siblings of the `<template>` element. Thus a
|
||||
directive in a child view cannot inject the directive that created it.
|
||||
|
||||
Since directives that create views via ViewContainers are common in Angular, and using the full `<template>` element syntax is wordy, Angular
|
||||
also supports a shorthand notation: `<li *foo="bar">` and `<li template="foo: bar">` are equivalent.
|
||||
|
||||
Thus,
|
||||
|
||||
```
|
||||
<ul>
|
||||
<li *foo="bar" title="text"></li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
Expands in use to:
|
||||
|
||||
```
|
||||
<ul>
|
||||
<template [foo]="bar">
|
||||
<li title="text"></li>
|
||||
</template>
|
||||
</ul>
|
||||
```
|
||||
|
||||
Notice that although the shorthand places `*foo="bar"` within the `<li>` element, the binding for the directive
|
||||
controller is correctly instantiated on the `<template>` element rather than the `<li>` element.
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
Let's suppose we want to implement the `unless` behavior, to conditionally include a template.
|
||||
|
||||
Here is a simple directive that triggers on an `unless` selector:
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: '[unless]',
|
||||
properties: {
|
||||
'unless': 'unless'
|
||||
}
|
||||
})
|
||||
export class Unless {
|
||||
viewContainer: ViewContainerRef;
|
||||
protoViewRef: ProtoViewRef;
|
||||
prevCondition: boolean;
|
||||
|
||||
constructor(viewContainer: ViewContainerRef, protoViewRef: ProtoViewRef) {
|
||||
this.viewContainer = viewContainer;
|
||||
this.protoViewRef = protoViewRef;
|
||||
this.prevCondition = null;
|
||||
}
|
||||
|
||||
set unless(newCondition) {
|
||||
if (newCondition && (isBlank(this.prevCondition) || !this.prevCondition)) {
|
||||
this.prevCondition = true;
|
||||
this.viewContainer.clear();
|
||||
} else if (!newCondition && (isBlank(this.prevCondition) || this.prevCondition)) {
|
||||
this.prevCondition = false;
|
||||
this.viewContainer.create(this.protoViewRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
We can then use this `unless` selector in a template:
|
||||
```
|
||||
<ul>
|
||||
<li *unless="expr"></li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
Once the directive instantiates the child view, the shorthand notation for the template expands and the result is:
|
||||
|
||||
```
|
||||
<ul>
|
||||
<template [unless]="exp">
|
||||
<li></li>
|
||||
</template>
|
||||
<li></li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
Note also that although the `<li></li>` template still exists inside the `<template></template>`, the instantiated
|
||||
view occurs on the second `<li></li>` which is a sibling to the `<template>` element.
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor({
|
||||
selector,
|
||||
properties,
|
||||
events,
|
||||
hostListeners,
|
||||
hostProperties,
|
||||
lifecycle,
|
||||
compileChildren = true,
|
||||
}:{
|
||||
selector:string,
|
||||
properties:any,
|
||||
events:List,
|
||||
hostListeners: any,
|
||||
hostProperties: any,
|
||||
lifecycle:List,
|
||||
compileChildren:boolean
|
||||
}={})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 compileChildren
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
If set to true the compiler does not compile the children of this directive.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 events
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Enumerates the set of emitted events.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Component({
|
||||
events: ['statusChange']
|
||||
})
|
||||
class TaskComponent {
|
||||
statusChange:EventEmitter;
|
||||
|
||||
constructor() {
|
||||
this.statusChange = new EventEmitter();
|
||||
}
|
||||
|
||||
onComplete() {
|
||||
this.statusChange.next('completed');
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hasLifecycleHook
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
hasLifecycleHook(hook:string)
|
||||
|
||||
:markdown
|
||||
|
||||
Returns true if a directive participates in a given `LifecycleEvent`.
|
||||
|
||||
See <a href='onChange-var.html'><code>onChange</code></a>, <a href='onDestroy-var.html'><code>onDestroy</code></a>, <a href='onAllChangesDone-var.html'><code>onAllChangesDone</code></a> for details.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostListeners
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifies which DOM hostListeners a directive listens to.
|
||||
|
||||
The `hostListeners` property defines a set of `event` to `method` key-value pairs:
|
||||
|
||||
- `event1`: the DOM event that the directive listens to.
|
||||
- `statement`: the statement to execute when the event occurs.
|
||||
If the evalutation of the statement returns `false`, then `preventDefault`is applied on the DOM event.
|
||||
|
||||
To listen to global events, a target must be added to the event name.
|
||||
The target can be `window`, `document` or `body`.
|
||||
|
||||
When writing a directive event binding, you can also refer to the following local variables:
|
||||
- `$event`: Current event object which triggered the event.
|
||||
- `$target`: The source of the event. This will be either a DOM element or an Angular directive.
|
||||
(will be implemented in later release)
|
||||
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Directive({
|
||||
hostListeners: {
|
||||
'event1': 'onMethod1(arguments)',
|
||||
'target:event2': 'onMethod2(arguments)',
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Basic Event Binding:
|
||||
|
||||
Suppose you want to write a directive that triggers on `change` events in the DOM and on `resize` events in window.
|
||||
You would define the event binding as follows:
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'input',
|
||||
hostListeners: {
|
||||
'change': 'onChange($event)',
|
||||
'window:resize': 'onResize($event)'
|
||||
}
|
||||
})
|
||||
class InputDirective {
|
||||
onChange(event:Event) {
|
||||
}
|
||||
onResize(event:Event) {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Here the `onChange` method of `InputDirective` is invoked whenever the DOM element fires the 'change' event.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostProperties
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifies which DOM properties a directives updates.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'input',
|
||||
hostProperties: {
|
||||
'value': 'value'
|
||||
}
|
||||
})
|
||||
class InputDirective {
|
||||
value:string;
|
||||
}
|
||||
|
||||
In this example every time the value property of the decorator changes, Angular will update the value property of
|
||||
the host element.
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 lifecycle
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifies a set of lifecycle hostListeners in which the directive participates.
|
||||
|
||||
See <a href='onChange-var.html'><code>onChange</code></a>, <a href='onDestroy-var.html'><code>onDestroy</code></a>, <a href='onAllChangesDone-var.html'><code>onAllChangesDone</code></a> for details.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 properties
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Enumerates the set of properties that accept data binding for a directive.
|
||||
|
||||
The `properties` property defines a set of `directiveProperty` to `bindingProperty`
|
||||
key-value pairs:
|
||||
|
||||
- `directiveProperty` specifies the component property where the value is written.
|
||||
- `bindingProperty` specifies the DOM property where the value is read from.
|
||||
|
||||
You can include a <a href='../pipes/Pipe-class.html'><code>Pipe</code></a> when specifying a `bindingProperty` to allow for data transformation and structural
|
||||
change detection of the value. These pipes will be evaluated in the context of this component.
|
||||
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Directive({
|
||||
properties: {
|
||||
'directiveProperty1': 'bindingProperty1',
|
||||
'directiveProperty2': 'bindingProperty2 | pipe1 | ...',
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Basic Property Binding
|
||||
|
||||
We can easily build a simple `Tooltip` directive that exposes a `tooltip` property, which can be used in templates
|
||||
with standard Angular syntax. For example:
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: '[tooltip]',
|
||||
properties: {
|
||||
'text': 'tooltip'
|
||||
}
|
||||
})
|
||||
class Tooltip {
|
||||
set text(text) {
|
||||
// This will get called every time the 'tooltip' binding changes with the new value.
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
We can then bind to the `tooltip' property as either an expression (`someExpression`) or as a string literal, as
|
||||
shown in the HTML template below:
|
||||
|
||||
```html
|
||||
<div [tooltip]="someExpression">...</div>
|
||||
<div tooltip="Some Text">...</div>
|
||||
```
|
||||
|
||||
Whenever the `someExpression` expression changes, the `properties` declaration instructs
|
||||
Angular to update the `Tooltip`'s `text` property.
|
||||
|
||||
|
||||
|
||||
## Bindings With Pipes
|
||||
|
||||
You can also use pipes when writing binding definitions for a directive.
|
||||
|
||||
For example, we could write a binding that updates the directive on structural changes, rather than on reference
|
||||
changes, as normally occurs in change detection.
|
||||
|
||||
See <a href='../pipes/Pipe-class.html'><code>Pipe</code></a> and <a href='../pipes/keyValDiff-var.html'><code>keyValDiff</code></a> documentation for more details.
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: '[class-set]',
|
||||
properties: {
|
||||
'classChanges': 'classSet | keyValDiff'
|
||||
}
|
||||
})
|
||||
class ClassSet {
|
||||
set classChanges(changes:KeyValueChanges) {
|
||||
// This will get called every time the `class-set` expressions changes its structure.
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The template that this directive is used in may also contain its own pipes. For example:
|
||||
|
||||
```html
|
||||
<div [class-set]="someExpression | somePipe">
|
||||
```
|
||||
|
||||
In this case, the two pipes compose as if they were inlined: `someExpression | somePipe | keyValDiff`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 selector
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
The CSS selector that triggers the instantiation of a directive.
|
||||
|
||||
Angular only allows directives to trigger on CSS selectors that do not cross element boundaries.
|
||||
|
||||
`selector` may be declared as one of the following:
|
||||
|
||||
- `element-name`: select by element name.
|
||||
- `.class`: select by class name.
|
||||
- `[attribute]`: select by attribute name.
|
||||
- `[attribute=value]`: select by attribute name and value.
|
||||
- `:not(sub_selector)`: select only if the element does not match the `sub_selector`.
|
||||
- `selector1, selector2`: select if either `selector1` or `selector2` matches.
|
||||
|
||||
|
||||
|
||||
|
||||
Suppose we have a directive with an `input[type=text]` selector.
|
||||
|
||||
And the following HTML:
|
||||
|
||||
```html
|
||||
<form>
|
||||
<input type="text">
|
||||
<input type="radio">
|
||||
<form>
|
||||
```
|
||||
|
||||
The directive would only be instantiated on the `<input type="text">` element.
|
||||
|
||||
|
||||
|
||||
|
|
@ -3,8 +3,10 @@
|
|||
h2 Directive <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L44-L44">angular2/src/core/annotations/decorators.ts (line 44)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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-L776">angular2/src/core/annotations_impl/annotations.ts (line 4)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/annotations.ts#L4-L801">angular2/src/core/annotations_impl/annotations.ts (line 4)</a>
|
||||
|
||||
:markdown
|
||||
Directives allow you to attach behavior to elements in the DOM.
|
||||
|
@ -229,14 +229,13 @@ p.location-badge.
|
|||
|
||||
### Injecting a live collection of descendant directives
|
||||
|
||||
Note: This is will be implemented in later release. ()
|
||||
|
||||
Similar to `@Query` above, but also includes the children of the child elements.
|
||||
By passing the descendant flag to `@Query` above, we can include the children of the child
|
||||
elements.
|
||||
|
||||
```
|
||||
@Directive({ selector: '[my-directive]' })
|
||||
class MyDirective {
|
||||
constructor(@QueryDescendents(Dependency) dependencies:QueryList<Dependency>) {
|
||||
constructor(@Query(Dependency, {descendants: true}) dependencies:QueryList<Dependency>) {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -414,20 +413,9 @@ p.location-badge.
|
|||
pre.prettyprint
|
||||
code.
|
||||
constructor({
|
||||
selector, properties, events, hostListeners, hostProperties, hostAttributes,
|
||||
hostActions, lifecycle, hostInjector, compileChildren = true,
|
||||
}: {
|
||||
selector?: string,
|
||||
properties?: List<string>,
|
||||
events?: List<string>,
|
||||
hostListeners?: StringMap<string, string>,
|
||||
hostProperties?: StringMap<string, string>,
|
||||
hostAttributes?: StringMap<string, string>,
|
||||
hostActions?: StringMap<string, string>,
|
||||
lifecycle?: List<LifecycleEvent>,
|
||||
hostInjector?: List<any>,
|
||||
compileChildren?: boolean
|
||||
} = {})
|
||||
selector, properties, events, host, lifecycle, hostInjector, exportAs,
|
||||
compileChildren = true,
|
||||
}?: DirectiveArgs)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -437,273 +425,40 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 compileChildren
|
||||
h3 selector
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
If set to true the compiler does not compile the children of this directive.
|
||||
The CSS selector that triggers the instantiation of a directive.
|
||||
|
||||
Angular only allows directives to trigger on CSS selectors that do not cross element
|
||||
boundaries.
|
||||
|
||||
`selector` may be declared as one of the following:
|
||||
|
||||
- `element-name`: select by element name.
|
||||
- `.class`: select by class name.
|
||||
- `[attribute]`: select by attribute name.
|
||||
- `[attribute=value]`: select by attribute name and value.
|
||||
- `:not(sub_selector)`: select only if the element does not match the `sub_selector`.
|
||||
- `selector1, selector2`: select if either `selector1` or `selector2` matches.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 events
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Enumerates the set of emitted events.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Component({
|
||||
events: ['statusChange']
|
||||
})
|
||||
class TaskComponent {
|
||||
statusChange:EventEmitter;
|
||||
Suppose we have a directive with an `input[type=text]` selector.
|
||||
|
||||
constructor() {
|
||||
this.statusChange = new EventEmitter();
|
||||
}
|
||||
And the following HTML:
|
||||
|
||||
onComplete() {
|
||||
this.statusChange.next('completed');
|
||||
}
|
||||
}
|
||||
```html
|
||||
<form>
|
||||
<input type="text">
|
||||
<input type="radio">
|
||||
<form>
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostActions
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifies which DOM methods a directive can invoke.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'input',
|
||||
hostActions: {
|
||||
'emitFocus': 'focus()'
|
||||
}
|
||||
})
|
||||
class InputDirective {
|
||||
constructor() {
|
||||
this.emitFocus = new EventEmitter();
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.emitFocus.next();
|
||||
}
|
||||
}
|
||||
|
||||
In this example calling focus on InputDirective will result in calling focus on the DOM
|
||||
element.
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostAttributes
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifies static attributes that should be propagated to a host element. Attributes specified
|
||||
in `hostAttributes`
|
||||
are propagated only if a given attribute is not present on a host element.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: '[my-button]',
|
||||
hostAttributes: {
|
||||
'role': 'button'
|
||||
}
|
||||
})
|
||||
class MyButton {
|
||||
}
|
||||
|
||||
In this example using `my-button` directive (ex.: `<div my-button></div>`) on a host element
|
||||
(here: `<div>` )
|
||||
will ensure that this element will get the "button" role.
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostInjector
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Defines the set of injectable objects that are visible to a Directive and its light dom
|
||||
children.
|
||||
|
||||
## Simple Example
|
||||
|
||||
Here is an example of a class that can be injected:
|
||||
|
||||
```
|
||||
class Greeter {
|
||||
greet(name:string) {
|
||||
return 'Hello ' + name + '!';
|
||||
}
|
||||
}
|
||||
|
||||
@Directive({
|
||||
selector: 'greet',
|
||||
hostInjector: [
|
||||
Greeter
|
||||
]
|
||||
})
|
||||
class HelloWorld {
|
||||
greeter:Greeter;
|
||||
|
||||
constructor(greeter:Greeter) {
|
||||
this.greeter = greeter;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostListeners
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifies which DOM hostListeners a directive listens to.
|
||||
|
||||
The `hostListeners` property defines a set of `event` to `method` key-value pairs:
|
||||
|
||||
- `event1`: the DOM event that the directive listens to.
|
||||
- `statement`: the statement to execute when the event occurs.
|
||||
If the evalutation of the statement returns `false`, then `preventDefault`is applied on the DOM
|
||||
event.
|
||||
|
||||
To listen to global events, a target must be added to the event name.
|
||||
The target can be `window`, `document` or `body`.
|
||||
|
||||
When writing a directive event binding, you can also refer to the following local variables:
|
||||
- `$event`: Current event object which triggered the event.
|
||||
- `$target`: The source of the event. This will be either a DOM element or an Angular
|
||||
directive.
|
||||
(will be implemented in later release)
|
||||
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Directive({
|
||||
hostListeners: {
|
||||
'event1': 'onMethod1(arguments)',
|
||||
'target:event2': 'onMethod2(arguments)',
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Basic Event Binding:
|
||||
|
||||
Suppose you want to write a directive that triggers on `change` events in the DOM and on
|
||||
`resize` events in window.
|
||||
You would define the event binding as follows:
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'input',
|
||||
hostListeners: {
|
||||
'change': 'onChange($event)',
|
||||
'window:resize': 'onResize($event)'
|
||||
}
|
||||
})
|
||||
class InputDirective {
|
||||
onChange(event:Event) {
|
||||
}
|
||||
onResize(event:Event) {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Here the `onChange` method of `InputDirective` is invoked whenever the DOM element fires the
|
||||
'change' event.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostProperties
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifies which DOM properties a directives updates.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'input',
|
||||
hostProperties: {
|
||||
'value': 'value'
|
||||
}
|
||||
})
|
||||
class InputDirective {
|
||||
value:string;
|
||||
}
|
||||
|
||||
In this example every time the value property of the decorator changes, Angular will update the
|
||||
value property of
|
||||
the host element.
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 lifecycle
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
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.
|
||||
The directive would only be instantiated on the `<input type="text">` element.
|
||||
|
||||
|
||||
|
||||
|
@ -783,7 +538,7 @@ p.location-badge.
|
|||
For example, we could write a binding that updates the directive on structural changes, rather
|
||||
than on reference changes, as normally occurs in change detection.
|
||||
|
||||
See <a href='../change_detection/Pipe-class.html'><code>Pipe</code></a> and <a href='pipes/keyValDiff'>keyValDiff</a> documentation for more details.
|
||||
See <a href='../change_detection/Pipe-class.html'><code>Pipe</code></a> and <a href='../pipes/KeyValueChanges-class.html'><code>KeyValueChanges</code></a> documentation for more details.
|
||||
|
||||
```
|
||||
@Directive({
|
||||
|
@ -815,40 +570,295 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 selector
|
||||
h3 events
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
The CSS selector that triggers the instantiation of a directive.
|
||||
Enumerates the set of emitted events.
|
||||
|
||||
Angular only allows directives to trigger on CSS selectors that do not cross element
|
||||
boundaries.
|
||||
## Syntax
|
||||
|
||||
`selector` may be declared as one of the following:
|
||||
```
|
||||
@Component({
|
||||
events: ['statusChange']
|
||||
})
|
||||
class TaskComponent {
|
||||
statusChange: EventEmitter;
|
||||
|
||||
- `element-name`: select by element name.
|
||||
- `.class`: select by class name.
|
||||
- `[attribute]`: select by attribute name.
|
||||
- `[attribute=value]`: select by attribute name and value.
|
||||
- `:not(sub_selector)`: select only if the element does not match the `sub_selector`.
|
||||
- `selector1, selector2`: select if either `selector1` or `selector2` matches.
|
||||
constructor() {
|
||||
this.statusChange = new EventEmitter();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Suppose we have a directive with an `input[type=text]` selector.
|
||||
|
||||
And the following HTML:
|
||||
|
||||
```html
|
||||
<form>
|
||||
<input type="text">
|
||||
<input type="radio">
|
||||
<form>
|
||||
onComplete() {
|
||||
this.statusChange.next('completed');
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The directive would only be instantiated on the `<input type="text">` element.
|
||||
Use `propertyName: eventName` when the event emitter property name is different from the name
|
||||
of the emitted event:
|
||||
|
||||
```
|
||||
@Component({
|
||||
events: ['status: statusChange']
|
||||
})
|
||||
class TaskComponent {
|
||||
status: EventEmitter;
|
||||
|
||||
constructor() {
|
||||
this.status = new EventEmitter();
|
||||
}
|
||||
|
||||
onComplete() {
|
||||
this.status.next('completed');
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 host
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifiy the events, actions, properties and attributes related to the host element.
|
||||
|
||||
## Events
|
||||
|
||||
Specifies which DOM hostListeners a directive listens to via a set of `(event)` to `method`
|
||||
key-value pairs:
|
||||
|
||||
- `event1`: the DOM event that the directive listens to.
|
||||
- `statement`: the statement to execute when the event occurs.
|
||||
If the evalutation of the statement returns `false`, then `preventDefault`is applied on the DOM
|
||||
event.
|
||||
|
||||
To listen to global events, a target must be added to the event name.
|
||||
The target can be `window`, `document` or `body`.
|
||||
|
||||
When writing a directive event binding, you can also refer to the following local variables:
|
||||
- `$event`: Current event object which triggered the event.
|
||||
- `$target`: The source of the event. This will be either a DOM element or an Angular
|
||||
directive. (will be implemented in later release)
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Directive({
|
||||
host: {
|
||||
'(event1)': 'onMethod1(arguments)',
|
||||
'(target:event2)': 'onMethod2(arguments)',
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Basic Event Binding:
|
||||
|
||||
Suppose you want to write a directive that reacts to `change` events in the DOM and on
|
||||
`resize` events in window.
|
||||
You would define the event binding as follows:
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'input',
|
||||
host: {
|
||||
'(change)': 'onChange($event)',
|
||||
'(window:resize)': 'onResize($event)'
|
||||
}
|
||||
})
|
||||
class InputDirective {
|
||||
onChange(event:Event) {
|
||||
// invoked when the input element fires the 'change' event
|
||||
}
|
||||
onResize(event:Event) {
|
||||
// invoked when the window fires the 'resize' event
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
Specifies which DOM properties a directives updates.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'input',
|
||||
host: {
|
||||
'[prop]': 'expression'
|
||||
}
|
||||
})
|
||||
class InputDirective {
|
||||
value:string;
|
||||
}
|
||||
```
|
||||
|
||||
In this example the prop property of the host element is updated with the expression value
|
||||
every time it changes.
|
||||
|
||||
## Attributes
|
||||
|
||||
Specifies static attributes that should be propagated to a host element. Attributes specified
|
||||
in `hostAttributes` are propagated only if a given attribute is not present on a host element.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: '[my-button]',
|
||||
host: {
|
||||
'role': 'button'
|
||||
}
|
||||
})
|
||||
class MyButton {
|
||||
}
|
||||
```
|
||||
|
||||
In this example using `my-button` directive (ex.: `<div my-button></div>`) on a host element
|
||||
(here: `<div>` ) will ensure that this element will get the "button" role.
|
||||
|
||||
## Actions
|
||||
|
||||
Specifies which DOM methods a directive can invoke.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'input',
|
||||
host: {
|
||||
'@emitFocus': 'focus()'
|
||||
}
|
||||
})
|
||||
class InputDirective {
|
||||
constructor() {
|
||||
this.emitFocus = new EventEmitter();
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.emitFocus.next();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In this example calling focus on InputDirective will result in calling focus on the input.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 lifecycle
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifies which lifecycle should be notified to the directive.
|
||||
|
||||
See <a href='onChange-const.html'><code>onChange</code></a>, <a href='onDestroy-const.html'><code>onDestroy</code></a>, <a href='onCheck-const.html'><code>onCheck</code></a>,
|
||||
<a href='onInit-const.html'><code>onInit</code></a>, <a href='onAllChangesDone-const.html'><code>onAllChangesDone</code></a> for details.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 compileChildren
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
If set to false the compiler does not compile the children of this directive.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostInjector
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Defines the set of injectable objects that are visible to a Directive and its light dom
|
||||
children.
|
||||
|
||||
## Simple Example
|
||||
|
||||
Here is an example of a class that can be injected:
|
||||
|
||||
```
|
||||
class Greeter {
|
||||
greet(name:string) {
|
||||
return 'Hello ' + name + '!';
|
||||
}
|
||||
}
|
||||
|
||||
@Directive({
|
||||
selector: 'greet',
|
||||
hostInjector: [
|
||||
Greeter
|
||||
]
|
||||
})
|
||||
class HelloWorld {
|
||||
greeter:Greeter;
|
||||
|
||||
constructor(greeter:Greeter) {
|
||||
this.greeter = greeter;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 exportAs
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Defines the name that can be used in the template to assign this directive to a variable.
|
||||
|
||||
## Simple Example
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'child-dir',
|
||||
exportAs: 'child'
|
||||
})
|
||||
class ChildDir {
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'main',
|
||||
})
|
||||
@View({
|
||||
template: `<child-dir #c="child"></child-dir>`,
|
||||
directives: [ChildDir]
|
||||
})
|
||||
class MainComponent {
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,113 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/annotations.ts#L801-L812">angular2/src/core/annotations_impl/annotations.ts (line 801)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 selector
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 properties
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 events
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 host
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 lifecycle
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostInjector
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 exportAs
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 compileChildren
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L16-L18">angular2/src/core/annotations/decorators.ts (line 16)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/visibility.js#L44">angular2/src/core/annotations_impl/visibility.js (line 44)</a>
|
||||
|
||||
:markdown
|
||||
Specifies that an injector should retrieve a dependency from the direct parent.
|
||||
|
||||
## Example
|
||||
|
||||
Here is a simple directive that retrieves a dependency from its parent element.
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: '[dependency]',
|
||||
properties: {
|
||||
'id':'dependency'
|
||||
}
|
||||
})
|
||||
class Dependency {
|
||||
id:string;
|
||||
}
|
||||
|
||||
|
||||
@Directive({
|
||||
selector: '[my-directive]'
|
||||
})
|
||||
class Dependency {
|
||||
constructor(@Parent() dependency:Dependency) {
|
||||
expect(dependency.id).toEqual(1);
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
We use this with the following HTML template:
|
||||
|
||||
```
|
||||
<div dependency="1">
|
||||
<div dependency="2" my-directive></div>
|
||||
</div>
|
||||
```
|
||||
The `@Parent()` annotation in our constructor forces the injector to retrieve the dependency from the
|
||||
parent element (even thought the current element could resolve it): Angular injects `dependency=1`.
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
h2 Parent <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L51-L51">angular2/src/core/annotations/decorators.ts (line 51)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/di.js#L55">angular2/src/core/annotations_impl/di.js (line 55)</a>
|
||||
|
||||
:markdown
|
||||
Specifies that a <a href='../view/QueryList-class.html'><code>QueryList</code></a> should be injected.
|
||||
|
||||
See <a href='../view/QueryList-class.html'><code>QueryList</code></a> for usage and example.
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(directive)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directive
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
h2 Query <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L57-L57">angular2/src/core/annotations/decorators.ts (line 57)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
h2 Self <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L50-L50">angular2/src/core/annotations/decorators.ts (line 50)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
h2 Unbounded <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L53-L53">angular2/src/core/annotations/decorators.ts (line 53)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,132 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/view.js#L34">angular2/src/core/annotations_impl/view.js (line 34)</a>
|
||||
|
||||
:markdown
|
||||
Declares the available HTML templates for an application.
|
||||
|
||||
Each angular component requires a single `@Component` and at least one `@View` annotation. The @View
|
||||
annotation specifies the HTML template to use, and lists the directives that are active within the template.
|
||||
|
||||
When a component is instantiated, the template is loaded into the component's shadow root, and the
|
||||
expressions and statements in the template are evaluated against the component.
|
||||
|
||||
For details on the `@Component` annotation, see <a href='Component-class.html'><code>Component</code></a>.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component({
|
||||
selector: 'greet'
|
||||
})
|
||||
@View({
|
||||
template: 'Hello {{name}}!',
|
||||
directives: [GreetUser, Bold]
|
||||
})
|
||||
class Greet {
|
||||
name: string;
|
||||
|
||||
constructor() {
|
||||
this.name = 'World';
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor({
|
||||
templateUrl,
|
||||
template,
|
||||
directives,
|
||||
renderer
|
||||
}: {
|
||||
templateUrl: string,
|
||||
template: string,
|
||||
directives: List<Type>,
|
||||
renderer: string
|
||||
})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directives
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifies a list of directives that can be used within a template.
|
||||
|
||||
Directives must be listed explicitly to provide proper component encapsulation.
|
||||
|
||||
|
||||
|
||||
```javascript
|
||||
@Component({
|
||||
selector: 'my-component'
|
||||
})
|
||||
@View({
|
||||
directives: [For]
|
||||
template: '
|
||||
<ul>
|
||||
<li *for="item in items">{{item}}</li>
|
||||
</ul>'
|
||||
})
|
||||
class MyComponent {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 renderer
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specify a custom renderer for this View.
|
||||
If this is set, neither `template`, `templateURL` nor `directives` are used.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 template
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifies an inline template for an angular component.
|
||||
|
||||
NOTE: either `templateUrl` or `template` should be used, but not both.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 templateUrl
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
Specifies a template URL for an angular component.
|
||||
|
||||
NOTE: either `templateUrl` or `template` should be used, but not both.
|
||||
|
||||
|
||||
|
||||
|
|
@ -3,8 +3,10 @@
|
|||
h2 View <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L47-L47">angular2/src/core/annotations/decorators.ts (line 47)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations/decorators.ts#L22-L24">angular2/src/core/annotations/decorators.ts (line 22)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 View
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
View(obj: ViewArgs)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -12,6 +12,14 @@
|
|||
"title" : "DirectiveAnnotation Class"
|
||||
},
|
||||
|
||||
"ComponentArgs-interface" : {
|
||||
"title" : "ComponentArgs Interface"
|
||||
},
|
||||
|
||||
"DirectiveArgs-interface" : {
|
||||
"title" : "DirectiveArgs Interface"
|
||||
},
|
||||
|
||||
"onDestroy-const" : {
|
||||
"title" : "onDestroy Const"
|
||||
},
|
||||
|
@ -32,14 +40,26 @@
|
|||
"title" : "onAllChangesDone Const"
|
||||
},
|
||||
|
||||
"Component-var" : {
|
||||
"title" : "Component Var"
|
||||
"DirectiveTypeDecorator-interface" : {
|
||||
"title" : "DirectiveTypeDecorator Interface"
|
||||
},
|
||||
|
||||
"ComponentTypeDecorator-interface" : {
|
||||
"title" : "ComponentTypeDecorator Interface"
|
||||
},
|
||||
|
||||
"ViewTypeDecorator-interface" : {
|
||||
"title" : "ViewTypeDecorator Interface"
|
||||
},
|
||||
|
||||
"Directive-var" : {
|
||||
"title" : "Directive Var"
|
||||
},
|
||||
|
||||
"Component-var" : {
|
||||
"title" : "Component Var"
|
||||
},
|
||||
|
||||
"View-var" : {
|
||||
"title" : "View Var"
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
p.location-badge.
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/annotations.ts#L1-L15">angular2/annotations.ts (line 1)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/annotations.ts#L1-L15">angular2/annotations.ts (line 1)</a>
|
||||
|
||||
ul
|
||||
for page, slug in public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]]._data
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
h2 onAllChangesDone <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/annotations.ts#L1127-L1127">angular2/src/core/annotations_impl/annotations.ts (line 1127)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when the bindings of all its children have been changed.
|
||||
Notify a directive when the bindings of all its children have been checked (whether they have
|
||||
changed or not).
|
||||
|
||||
## Example:
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
h2 onAllChangesDone <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when the bindings of all its children have been changed.
|
||||
|
||||
## Example:
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: '[class-set]',
|
||||
lifecycle: [onAllChangesDone]
|
||||
})
|
||||
class ClassSet {
|
||||
|
||||
onAllChangesDone() {
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
h2 onChange <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/annotations.ts#L1057-L1057">angular2/src/core/annotations_impl/annotations.ts (line 1057)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when any of its bindings have changed.
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
h2 onChange <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">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: {
|
||||
'propA': 'propA'
|
||||
'propB': 'propB'
|
||||
},
|
||||
lifecycle: [onChange]
|
||||
})
|
||||
class ClassSet {
|
||||
propA;
|
||||
propB;
|
||||
onChange(changes:{[idx: string, PropertyUpdate]}) {
|
||||
// This will get called after any of the properties have been updated.
|
||||
if (changes['propA']) {
|
||||
// if propA was updated
|
||||
}
|
||||
if (changes['propA']) {
|
||||
// if propB was updated
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
h2 onCheck <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/annotations.ts#L1081-L1081">angular2/src/core/annotations_impl/annotations.ts (line 1081)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when it has been checked.
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
h2 onDestroy <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/annotations.ts#L1019-L1019">angular2/src/core/annotations_impl/annotations.ts (line 1019)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive whenever a <a href='View-var.html'><code>View</code></a> that contains it is destroyed.
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
h2 onDestroy <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive whenever a <a href='View-class.html'><code>View</code></a> that contains it is destroyed.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Directive({
|
||||
...,
|
||||
lifecycle: [onDestroy]
|
||||
})
|
||||
class ClassSet {
|
||||
onDestroy() {
|
||||
// invoked to notify directive of the containing view destruction.
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
h2 onInit <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../annotations'>angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/annotations.ts#L1105-L1105">angular2/src/core/annotations_impl/annotations.ts (line 1105)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when it has been checked the first itme.
|
||||
|
|
|
@ -1,37 +1,20 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/parser/ast.ts#L2-L14">angular2/src/change_detection/parser/ast.ts (line 2)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/parser/ast.ts#L3-L15">angular2/src/change_detection/parser/ast.ts (line 3)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 assign
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
assign(context, locals, value)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 eval
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
eval(context, locals)
|
||||
eval(context, locals: Locals)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -55,6 +38,40 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 assign
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
assign(context, locals: Locals, value)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visit(visitor: AstVisitor)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 toString
|
||||
|
||||
|
@ -71,20 +88,3 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visit(visitor)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/parser/ast.ts#L296-L310">angular2/src/change_detection/parser/ast.ts (line 296)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/parser/ast.ts#L311-L325">angular2/src/change_detection/parser/ast.ts (line 311)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public ast: AST, public source: string, public location: string)
|
||||
constructor(ast: AST, source: string, location: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -23,23 +23,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 assign
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
assign(context, locals, value)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ast
|
||||
|
||||
|
@ -54,24 +37,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 eval
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
eval(context, locals)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 isAssignable
|
||||
h3 source
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -97,9 +63,60 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 source
|
||||
h3 eval
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
eval(context, locals: Locals)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 isAssignable
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 assign
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
assign(context, locals: Locals, value)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visit(visitor: AstVisitor)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
@ -125,20 +142,3 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visit(visitor)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/parser/ast.ts#L60-L92">angular2/src/change_detection/parser/ast.ts (line 60)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/parser/ast.ts#L75-L107">angular2/src/change_detection/parser/ast.ts (line 75)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public receiver: AST, public name: string, public getter: Function, public setter: Function)
|
||||
constructor(receiver: AST, name: string, getter: Function, setter: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -24,54 +24,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 assign
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
assign(context, locals, value)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 eval
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
eval(context, locals)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 getter
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 isAssignable
|
||||
h3 receiver
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -97,7 +50,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 receiver
|
||||
h3 getter
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -123,12 +76,59 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 visit
|
||||
h3 eval
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visit(visitor)
|
||||
eval(context, locals: Locals)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 isAssignable
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 assign
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
assign(context, locals: Locals, value)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visit(visitor: AstVisitor)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,98 +1,13 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/parser/ast.ts#L335-L396">angular2/src/change_detection/parser/ast.ts (line 335)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/parser/ast.ts#L351-L423">angular2/src/change_detection/parser/ast.ts (line 351)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 visitAccessMember
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitAccessMember(ast: AccessMember)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitAll
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitAll(asts: List<any>)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitBinary
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitBinary(ast: Binary)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitConditional
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitConditional(ast: Conditional)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitFunctionCall
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitFunctionCall(ast: FunctionCall)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitImplicitReceiver
|
||||
|
||||
|
@ -128,12 +43,97 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitKeyedAccess
|
||||
h3 visitLiteralPrimitive
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitKeyedAccess(ast: KeyedAccess)
|
||||
visitLiteralPrimitive(ast: LiteralPrimitive)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitAccessMember
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitAccessMember(ast: AccessMember)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitSafeAccessMember
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitSafeAccessMember(ast: SafeAccessMember)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitMethodCall
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitMethodCall(ast: MethodCall)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitSafeMethodCall
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitSafeMethodCall(ast: SafeMethodCall)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitFunctionCall
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitFunctionCall(ast: FunctionCall)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -179,46 +179,12 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitLiteralPrimitive
|
||||
h3 visitBinary
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitLiteralPrimitive(ast: LiteralPrimitive)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitMethodCall
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitMethodCall(ast: MethodCall)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitPipe
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitPipe(ast: Pipe)
|
||||
visitBinary(ast: Binary)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -247,12 +213,12 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitSafeAccessMember
|
||||
h3 visitConditional
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitSafeAccessMember(ast: SafeAccessMember)
|
||||
visitConditional(ast: Conditional)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -264,12 +230,97 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitSafeMethodCall
|
||||
h3 visitPipe
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitSafeMethodCall(ast: SafeMethodCall)
|
||||
visitPipe(ast: Pipe)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitKeyedAccess
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitKeyedAccess(ast: KeyedAccess)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitAll
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitAll(asts: List<any>)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitChain
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitChain(ast: Chain)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitAssignment
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitAssignment(ast: Assignment)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visitIf
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visitIf(ast: If)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/binding_record.ts#L9-L62">angular2/src/change_detection/binding_record.ts (line 9)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/binding_record.ts#L9-L65">angular2/src/change_detection/binding_record.ts (line 9)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public mode: string, public implicitReceiver: any, public ast: AST, public elementIndex: number, public propertyName: string, public setter: SetterFn, public lifecycleEvent: string, public directiveRecord: DirectiveRecord)
|
||||
constructor(mode: string, implicitReceiver: any, ast: AST, elementIndex: number, propertyName: string, setter: SetterFn, lifecycleEvent: string, directiveRecord: DirectiveRecord)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -23,6 +23,32 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 mode
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 implicitReceiver
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ast
|
||||
|
||||
|
@ -36,6 +62,71 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 elementIndex
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 propertyName
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 setter
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 lifecycleEvent
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directiveRecord
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 callOnChange
|
||||
|
||||
|
@ -54,34 +145,12 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 directiveRecord
|
||||
h3 isOnPushChangeDetection
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 elementIndex
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 implicitReceiver
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
isOnPushChangeDetection()
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -143,23 +212,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 isOnPushChangeDetection
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
isOnPushChangeDetection()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 isTextNode
|
||||
|
||||
|
@ -176,55 +228,3 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 lifecycleEvent
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 mode
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 propertyName
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 setter
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
h2 CHECKED <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/constants.ts#L13-L13">angular2/src/change_detection/constants.ts (line 13)</a>
|
||||
|
||||
:markdown
|
||||
CHECKED means that the change detector should be skipped until its mode changes to
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
h2 CHECK_ALWAYS <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/constants.ts#L19-L19">angular2/src/change_detection/constants.ts (line 19)</a>
|
||||
|
||||
:markdown
|
||||
CHECK_ALWAYS means that after calling detectChanges the mode of the change detector
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
h2 CHECK_ONCE <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/constants.ts#L7-L7">angular2/src/change_detection/constants.ts (line 7)</a>
|
||||
|
||||
:markdown
|
||||
CHECK_ONCE means that after calling detectChanges the mode of the change detector
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/interfaces.ts#L8-L39">angular2/src/change_detection/interfaces.ts (line 8)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/interfaces.ts#L4-L36">angular2/src/change_detection/interfaces.ts (line 4)</a>
|
||||
|
||||
:markdown
|
||||
Interface used by Angular to control the change detection strategy for an application.
|
||||
|
@ -20,7 +20,8 @@ p.location-badge.
|
|||
`JitChangeDetection` strategy at compile time.
|
||||
|
||||
|
||||
See: <a href='DynamicChangeDetection-class.html'><code>DynamicChangeDetection</code></a>, <a href='JitChangeDetection-class.html'><code>JitChangeDetection</code></a>
|
||||
See: <a href='DynamicChangeDetection-class.html'><code>DynamicChangeDetection</code></a>, <a href='JitChangeDetection-class.html'><code>JitChangeDetection</code></a>,
|
||||
<a href='PreGeneratedChangeDetection-class.html'><code>PreGeneratedChangeDetection</code></a>
|
||||
|
||||
# Example
|
||||
```javascript
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/exceptions.ts#L15-L30">angular2/src/change_detection/exceptions.ts (line 15)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/exceptions.ts#L15-L28">angular2/src/change_detection/exceptions.ts (line 15)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -24,7 +24,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 location
|
||||
h3 message
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -37,7 +37,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 message
|
||||
h3 location
|
||||
|
||||
|
||||
:markdown
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/interfaces.ts#L43-L60">angular2/src/change_detection/interfaces.ts (line 43)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/interfaces.ts#L41-L58">angular2/src/change_detection/interfaces.ts (line 41)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -9,115 +9,9 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 addChild
|
||||
h3 parent
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
addChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 addShadowDomChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
addShadowDomChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 checkNoChanges
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
checkNoChanges()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 dehydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
dehydrate()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 detectChanges
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
detectChanges()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
hydrate(context: any, locals: Locals, directives: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 markPathToRootAsCheckOnce
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
markPathToRootAsCheckOnce()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
@ -141,9 +35,13 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 parent
|
||||
h3 addChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
addChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
@ -154,12 +52,12 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 remove
|
||||
h3 addShadowDomChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
remove()
|
||||
addShadowDomChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -203,3 +101,105 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 remove
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
remove()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
hydrate(context: any, locals: Locals, directives: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 dehydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
dehydrate()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 markPathToRootAsCheckOnce
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
markPathToRootAsCheckOnce()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 detectChanges
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
detectChanges()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 checkNoChanges
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
checkNoChanges()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/interfaces.ts#L60-L66">angular2/src/change_detection/interfaces.ts (line 60)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/interfaces.ts#L60-L66">angular2/src/change_detection/interfaces.ts (line 60)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public id: string, public strategy: string, public variableNames: List<string>, public bindingRecords: List<BindingRecord>, public directiveRecords: List<DirectiveRecord>)
|
||||
constructor(id: string, strategy: string, variableNames: List<string>, bindingRecords: List<BindingRecord>, directiveRecords: List<DirectiveRecord>)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -23,32 +23,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 bindingRecords
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directiveRecords
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 id
|
||||
|
||||
|
@ -87,3 +61,29 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 bindingRecords
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directiveRecords
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/change_detector_ref.ts#L2-L39">angular2/src/change_detection/change_detector_ref.ts (line 2)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/change_detector_ref.ts#L2-L39">angular2/src/change_detection/change_detector_ref.ts (line 2)</a>
|
||||
|
||||
:markdown
|
||||
Controls change detection.
|
||||
|
@ -18,7 +18,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(private _cd: ChangeDetector)
|
||||
constructor(_cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -27,6 +27,24 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 requestCheck
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
requestCheck()
|
||||
|
||||
:markdown
|
||||
|
||||
Request to check all ON_PUSH ancestors.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 detach
|
||||
|
||||
|
@ -68,21 +86,3 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 requestCheck
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
requestCheck()
|
||||
|
||||
:markdown
|
||||
|
||||
Request to check all ON_PUSH ancestors.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/interfaces.ts#L39-L43">angular2/src/change_detection/interfaces.ts (line 39)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 notifyOnBinding
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
notifyOnBinding(bindingRecord: BindingRecord, value: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/interfaces.ts#L36-L41">angular2/src/change_detection/interfaces.ts (line 36)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 notifyOnBinding
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
notifyOnBinding(bindingRecord: BindingRecord, value: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 notifyOnAllChangesDone
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
notifyOnAllChangesDone()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
h2 DEFAULT <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/constants.ts#L35-L35">angular2/src/change_detection/constants.ts (line 35)</a>
|
||||
|
||||
:markdown
|
||||
DEFAULT means that the change detector's mode will be set to CHECK_ALWAYS during hydration.
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
h2 DETACHED <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/constants.ts#L25-L25">angular2/src/change_detection/constants.ts (line 25)</a>
|
||||
|
||||
:markdown
|
||||
DETACHED means that the change detector sub tree is not a part of the main tree and
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/exceptions.ts#L28-L32">angular2/src/change_detection/exceptions.ts (line 28)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/directive_record.ts#L2-L8">angular2/src/change_detection/directive_record.ts (line 2)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/directive_record.ts#L2-L8">angular2/src/change_detection/directive_record.ts (line 2)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public elementIndex: number, public directiveIndex: number)
|
||||
constructor(elementIndex: number, directiveIndex: number)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -23,19 +23,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directiveIndex
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 elementIndex
|
||||
|
||||
|
@ -49,6 +36,19 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directiveIndex
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 name
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/directive_record.ts#L8-L36">angular2/src/change_detection/directive_record.ts (line 8)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/directive_record.ts#L8-L36">angular2/src/change_detection/directive_record.ts (line 8)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -15,14 +15,14 @@ p.location-badge.
|
|||
pre.prettyprint
|
||||
code.
|
||||
constructor({directiveIndex, callOnAllChangesDone, callOnChange, callOnCheck, callOnInit,
|
||||
changeDetection}: {
|
||||
changeDetection}?: {
|
||||
directiveIndex?: DirectiveIndex,
|
||||
callOnAllChangesDone?: boolean,
|
||||
callOnChange?: boolean,
|
||||
callOnCheck?: boolean,
|
||||
callOnInit?: boolean,
|
||||
changeDetection?: string
|
||||
} = {})
|
||||
})
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -31,6 +31,19 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directiveIndex
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 callOnAllChangesDone
|
||||
|
||||
|
@ -96,19 +109,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directiveIndex
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 isOnPushChangeDetection
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/change_detection.ts#L95-L112">angular2/src/change_detection/change_detection.ts (line 95)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/change_detection.ts#L112-L129">angular2/src/change_detection/change_detection.ts (line 112)</a>
|
||||
|
||||
:markdown
|
||||
Implements change detection that does not require `eval()`.
|
||||
|
@ -16,7 +16,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(private registry: PipeRegistry)
|
||||
constructor(registry: PipeRegistry)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -25,6 +25,19 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registry
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 createProtoChangeDetector
|
||||
|
||||
|
@ -41,16 +54,3 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registry
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/dynamic_change_detector.ts#L27-L334">angular2/src/change_detection/dynamic_change_detector.ts (line 27)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/dynamic_change_detector.ts#L13-L326">angular2/src/change_detection/dynamic_change_detector.ts (line 13)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(private changeControlStrategy: string, private dispatcher: any, private pipeRegistry: PipeRegistry, private protos: List<ProtoRecord>, private directiveRecords: List<any>)
|
||||
constructor(id: string, changeControlStrategy: string, dispatcher: any, pipeRegistry: PipeRegistry, protos: List<ProtoRecord>, directiveRecords: List<any>)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -23,169 +23,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 alreadyChecked
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 callOnAllChangesDone
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
callOnAllChangesDone()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 changeControlStrategy
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 changes
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 dehydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
dehydrate()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 detectChangesInRecords
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
detectChangesInRecords(throwOnChange: boolean)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directiveRecords
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directives
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 dispatcher
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
hydrate(context: any, locals: any, directives: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hydrated
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
hydrated()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 locals
|
||||
|
||||
|
@ -200,7 +37,20 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 pipeRegistry
|
||||
h3 values
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 changes
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -238,6 +88,71 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 directives
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 alreadyChecked
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 changeControlStrategy
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 dispatcher
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 pipeRegistry
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 protos
|
||||
|
||||
|
@ -252,7 +167,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 values
|
||||
h3 directiveRecords
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -263,3 +178,88 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
hydrate(context: any, locals: Locals, directives: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 dehydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
dehydrate()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hydrated
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
hydrated()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 detectChangesInRecords
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
detectChangesInRecords(throwOnChange: boolean)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 callOnAllChangesDone
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
callOnAllChangesDone()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/proto_change_detector.ts#L58-L79">angular2/src/change_detection/proto_change_detector.ts (line 58)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/proto_change_detector.ts#L37-L58">angular2/src/change_detection/proto_change_detector.ts (line 37)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(private _pipeRegistry: PipeRegistry, private definition: ChangeDetectorDefinition)
|
||||
constructor(_pipeRegistry: PipeRegistry, definition: ChangeDetectorDefinition)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/exceptions.ts#L2-L15">angular2/src/change_detection/exceptions.ts (line 2)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/exceptions.ts#L2-L15">angular2/src/change_detection/exceptions.ts (line 2)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/parser/ast.ts#L22-L28">angular2/src/change_detection/parser/ast.ts (line 22)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/parser/ast.ts#L23-L29">angular2/src/change_detection/parser/ast.ts (line 23)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
eval(context, locals)
|
||||
eval(context, locals: Locals)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -31,7 +31,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visit(visitor)
|
||||
visit(visitor: AstVisitor)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/change_detection.ts#L112-L129">angular2/src/change_detection/change_detection.ts (line 112)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/change_detection.ts#L129-L148">angular2/src/change_detection/change_detection.ts (line 129)</a>
|
||||
|
||||
:markdown
|
||||
Implements faster change detection, by generating source code.
|
||||
Implements faster change detection by generating source code.
|
||||
|
||||
This requires `eval()`. For change detection that does not require `eval()`, see
|
||||
<a href='DynamicChangeDetection-class.html'><code>DynamicChangeDetection</code></a>.
|
||||
<a href='DynamicChangeDetection-class.html'><code>DynamicChangeDetection</code></a> and <a href='PreGeneratedChangeDetection-class.html'><code>PreGeneratedChangeDetection</code></a>.
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
|
@ -17,7 +17,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public registry: PipeRegistry)
|
||||
constructor(registry: PipeRegistry)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -26,6 +26,19 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registry
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 createProtoChangeDetector
|
||||
|
||||
|
@ -42,16 +55,3 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registry
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/proto_change_detector.ts#L81-L103">angular2/src/change_detection/proto_change_detector.ts (line 81)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(private _pipeRegistry, private definition: ChangeDetectorDefinition)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 definition
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 instantiate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
instantiate(dispatcher: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/parser/lexer.ts#L10-L24">angular2/src/change_detection/parser/lexer.ts (line 10)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/parser/lexer.ts#L18-L31">angular2/src/change_detection/parser/lexer.ts (line 18)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/change_detection.html">angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/life_cycle/life_cycle.js#L31">angular2/src/core/life_cycle/life_cycle.js (line 31)</a>
|
||||
|
||||
:markdown
|
||||
Provides access to explicitly trigger change detection in an application.
|
||||
|
||||
By default, `Zone` triggers change detection in Angular on each virtual machine (VM) turn. When testing, or in some
|
||||
limited application use cases, a developer can also trigger change detection with the `lifecycle.tick()` method.
|
||||
|
||||
Each Angular application has a single `LifeCycle` instance.
|
||||
|
||||
# Example
|
||||
|
||||
This is a contrived example, since the bootstrap automatically runs inside of the `Zone`, which invokes
|
||||
`lifecycle.tick()` on your behalf.
|
||||
|
||||
```javascript
|
||||
bootstrap(MyApp).then((ref:ComponentRef) => {
|
||||
var lifeCycle = ref.injector.get(LifeCycle);
|
||||
var myApp = ref.instance;
|
||||
|
||||
ref.doSomething();
|
||||
lifecycle.tick();
|
||||
});
|
||||
```
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(exceptionHandler:ExceptionHandler, changeDetector:ChangeDetector = null, enforceNoNewChanges:boolean = false)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 tick
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
tick()
|
||||
|
||||
:markdown
|
||||
|
||||
Invoke this method to explicitly process change detection and its side-effects.
|
||||
|
||||
In development mode, `tick()` also performs a second change detection cycle to ensure that no further
|
||||
changes are detected. If additional changes are picked up during this second cycle, bindings in the app have
|
||||
side-effects that cannot be resolved in a single change detection pass. In this case, Angular throws an error,
|
||||
since an Angular application can only have one change detection pass during which all change detection must
|
||||
complete.
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/parser/ast.ts#L144-L154">angular2/src/change_detection/parser/ast.ts (line 144)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/parser/ast.ts#L159-L169">angular2/src/change_detection/parser/ast.ts (line 159)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public expressions: List<any>)
|
||||
constructor(expressions: List<any>)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -23,23 +23,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 eval
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
eval(context, locals)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 expressions
|
||||
|
||||
|
@ -54,12 +37,29 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 visit
|
||||
h3 eval
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visit(visitor)
|
||||
eval(context, locals: Locals)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
visit(visitor: AstVisitor)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/parser/locals.ts#L2-L43">angular2/src/change_detection/parser/locals.ts (line 2)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/parser/locals.ts#L2-L44">angular2/src/change_detection/parser/locals.ts (line 2)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public parent: Locals, public current: Map<any, any>)
|
||||
constructor(parent: Locals, current: Map<any, any>)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -24,12 +24,21 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 clearValues
|
||||
h3 parent
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
clearValues()
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 current
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -57,19 +66,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 current
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 get
|
||||
|
||||
|
@ -87,19 +83,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 parent
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 set
|
||||
|
||||
|
@ -116,3 +99,20 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 clearValues
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
clearValues()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,27 +1,12 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/pipes/null_pipe.ts#L14-L38">angular2/src/change_detection/pipes/null_pipe.ts (line 14)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/pipes/null_pipe.ts#L14-L34">angular2/src/change_detection/pipes/null_pipe.ts (line 14)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 called
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/pipes/null_pipe.ts#L2-L14">angular2/src/change_detection/pipes/null_pipe.ts (line 2)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/pipes/null_pipe.ts#L2-L14">angular2/src/change_detection/pipes/null_pipe.ts (line 2)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -22,23 +22,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 create
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
create(cdRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 supports
|
||||
|
||||
|
@ -55,3 +38,20 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 create
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
create(cdRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
h2 ON_PUSH <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/constants.ts#L30-L30">angular2/src/change_detection/constants.ts (line 30)</a>
|
||||
|
||||
:markdown
|
||||
ON_PUSH means that the change detector's mode will be set to CHECK_ONCE during hydration.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/parser/parser.ts#L53-L115">angular2/src/change_detection/parser/parser.ts (line 53)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/parser/parser.ts#L54-L115">angular2/src/change_detection/parser/parser.ts (line 54)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(lexer: Lexer, providedReflector: Reflector = null)
|
||||
constructor(_lexer: Lexer, providedReflector?: Reflector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -23,23 +23,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 addPipes
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
addPipes(bindingAst: ASTWithSource, pipes: List<string>)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 parseAction
|
||||
|
||||
|
@ -75,12 +58,12 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 parseInterpolation
|
||||
h3 addPipes
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
parseInterpolation(input: string, location: any)
|
||||
addPipes(bindingAst: ASTWithSource, pipes: List<string>)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -108,6 +91,23 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 parseInterpolation
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
parseInterpolation(input: string, location: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 wrapLiteralPrimitive
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/pipes/pipe.ts#L29-L56">angular2/src/change_detection/pipes/pipe.ts (line 29)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/pipes/pipe.ts#L29-L56">angular2/src/change_detection/pipes/pipe.ts (line 29)</a>
|
||||
|
||||
:markdown
|
||||
An interface for extending the list of pipes known to Angular.
|
||||
|
@ -25,12 +25,12 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 onDestroy
|
||||
h3 supports
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
onDestroy()
|
||||
supports(obj)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -42,12 +42,12 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 supports
|
||||
h3 onDestroy
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
supports(obj)
|
||||
onDestroy()
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,30 +1,13 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/pipes/pipe.ts#L56-L70">angular2/src/change_detection/pipes/pipe.ts (line 56)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/pipes/pipe.ts#L56-L70">angular2/src/change_detection/pipes/pipe.ts (line 56)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 create
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
create(cdRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 supports
|
||||
|
||||
|
@ -41,3 +24,20 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 create
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
create(cdRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/pipes/pipe_registry.ts#L5-L25">angular2/src/change_detection/pipes/pipe_registry.ts (line 5)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/pipes/pipe_registry.ts#L5-L25">angular2/src/change_detection/pipes/pipe_registry.ts (line 5)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public config)
|
||||
constructor(config)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/change_detection.ts#L69-L95">angular2/src/change_detection/change_detection.ts (line 69)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/change_detection.ts#L80-L112">angular2/src/change_detection/change_detection.ts (line 80)</a>
|
||||
|
||||
:markdown
|
||||
Implements change detection using a map of pregenerated proto detectors.
|
||||
|
@ -14,7 +14,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(private registry: PipeRegistry, protoChangeDetectors?)
|
||||
constructor(registry: PipeRegistry, protoChangeDetectorsForTest?: StringMap<string, Function>)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -23,6 +23,19 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registry
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 createProtoChangeDetector
|
||||
|
||||
|
@ -39,16 +52,3 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registry
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/interfaces.ts#L4-L8">angular2/src/change_detection/interfaces.ts (line 4)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/interfaces.ts#L58-L60">angular2/src/change_detection/interfaces.ts (line 58)</a>
|
||||
|
||||
:markdown
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/pipes/pipe.ts#L1-L19">angular2/src/change_detection/pipes/pipe.ts (line 1)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/pipes/pipe.ts#L1-L19">angular2/src/change_detection/pipes/pipe.ts (line 1)</a>
|
||||
|
||||
:markdown
|
||||
Indicates that the result of a <a href='Pipe-class.html'><code>Pipe</code></a> transformation has changed even though the reference
|
||||
|
@ -17,7 +17,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public wrapped: any)
|
||||
constructor(wrapped: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -40,6 +40,10 @@
|
|||
"title" : "Locals Class"
|
||||
},
|
||||
|
||||
"DehydratedException-class" : {
|
||||
"title" : "DehydratedException Class"
|
||||
},
|
||||
|
||||
"ExpressionChangedAfterItHasBeenChecked-class" : {
|
||||
"title" : "ExpressionChangedAfterItHasBeenChecked Class"
|
||||
},
|
||||
|
@ -48,16 +52,16 @@
|
|||
"title" : "ChangeDetectionError Class"
|
||||
},
|
||||
|
||||
"ProtoChangeDetector-class" : {
|
||||
"title" : "ProtoChangeDetector Class"
|
||||
"ProtoChangeDetector-interface" : {
|
||||
"title" : "ProtoChangeDetector Interface"
|
||||
},
|
||||
|
||||
"ChangeDispatcher-class" : {
|
||||
"title" : "ChangeDispatcher Class"
|
||||
"ChangeDetector-interface" : {
|
||||
"title" : "ChangeDetector Interface"
|
||||
},
|
||||
|
||||
"ChangeDetector-class" : {
|
||||
"title" : "ChangeDetector Class"
|
||||
"ChangeDispatcher-interface" : {
|
||||
"title" : "ChangeDispatcher Interface"
|
||||
},
|
||||
|
||||
"ChangeDetection-class" : {
|
||||
|
@ -96,10 +100,6 @@
|
|||
"title" : "DynamicProtoChangeDetector Class"
|
||||
},
|
||||
|
||||
"JitProtoChangeDetector-class" : {
|
||||
"title" : "JitProtoChangeDetector Class"
|
||||
},
|
||||
|
||||
"BindingRecord-class" : {
|
||||
"title" : "BindingRecord Class"
|
||||
},
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
h2 defaultPipeRegistry <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/change_detection.ts#L150-L150">angular2/src/change_detection/change_detection.ts (line 150)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
h2 defaultPipes <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/change_detection.ts#L62-L69">angular2/src/change_detection/change_detection.ts (line 62)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
p.location-badge.
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/change_detection.ts#L1-L60">angular2/change_detection.ts (line 1)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/change_detection.ts#L1-L58">angular2/change_detection.ts (line 1)</a>
|
||||
|
||||
ul
|
||||
for page, slug in public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]]._data
|
||||
|
|
|
@ -3,8 +3,12 @@
|
|||
h2 preGeneratedProtoDetectors <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/change_detection.ts#L78-L78">angular2/src/change_detection/change_detection.ts (line 78)</a>
|
||||
|
||||
:markdown
|
||||
Map from <a href='ChangeDetectorDefinition-class.html#id'><code>ChangeDetectorDefinition</code></a> to a factory method which takes a
|
||||
<a href='PipeRegistry-class.html'><code>PipeRegistry</code></a> and a <a href='ChangeDetectorDefinition-class.html'><code>ChangeDetectorDefinition</code></a> and generates a
|
||||
<a href='ProtoChangeDetector-interface.html'><code>ProtoChangeDetector</code></a> associated with the definition.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
h2 uninitialized <span class="type">variable</span>
|
||||
p.location-badge.
|
||||
exported from <a href='../change_detection'>angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/change_detection/change_detection_util.ts#L8-L8">angular2/src/change_detection/change_detection_util.ts (line 8)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/visibility.ts#L105-L166">angular2/src/core/annotations_impl/visibility.ts (line 105)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/visibility.ts#L110-L173">angular2/src/core/annotations_impl/visibility.ts (line 110)</a>
|
||||
|
||||
:markdown
|
||||
Specifies that an injector should retrieve a dependency from any ancestor element within the same
|
||||
shadow boundary.
|
||||
|
||||
An ancestor is any element between the parent element and shadow root.
|
||||
An ancestor is any element between the parent element and the shadow root.
|
||||
|
||||
Use <a href='../annotations/Unbounded-var.html'><code>Unbounded</code></a> if you need to cross upper shadow boundaries.
|
||||
|
||||
## Example
|
||||
|
||||
|
@ -65,7 +66,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor({self}: {self?: boolean} = {})
|
||||
constructor({self}?: {self?: boolean})
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -73,3 +74,20 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 toString
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
toString()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/application.ts#L311-L333">angular2/src/core/application.ts (line 311)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/application.ts#L317-L339">angular2/src/core/application.ts (line 317)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -24,13 +24,9 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 dispose
|
||||
h3 hostComponentType
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
dispose()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
@ -54,9 +50,13 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostComponentType
|
||||
h3 dispose
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
dispose()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/di.ts#L2-L44">angular2/src/core/annotations_impl/di.ts (line 2)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/di.ts#L3-L46">angular2/src/core/annotations_impl/di.ts (line 3)</a>
|
||||
|
||||
:markdown
|
||||
Specifies that a constant attribute value should be injected.
|
||||
|
@ -37,7 +37,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public attributeName: string)
|
||||
constructor(attributeName: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -71,3 +71,20 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 toString
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
toString()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/compiler.ts#L46-L257">angular2/src/core/compiler/compiler.ts (line 46)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/compiler.ts#L58-L269">angular2/src/core/compiler/compiler.ts (line 58)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -13,7 +13,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(reader: DirectiveResolver, cache: CompilerCache, templateResolver: TemplateResolver, componentUrlMapper: ComponentUrlMapper, urlResolver: UrlResolver, render: renderApi.RenderCompiler, protoViewFactory: ProtoViewFactory)
|
||||
constructor(reader: DirectiveResolver, cache: CompilerCache, templateResolver: TemplateResolver, componentUrlMapper: ComponentUrlMapper, urlResolver: UrlResolver, render:RenderCompiler, protoViewFactory: ProtoViewFactory)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -22,23 +22,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 compile
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
compile(component: Type)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 compileInHost
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/compiler.ts#L25-L46">angular2/src/core/compiler/compiler.ts (line 25)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/compiler.ts#L27-L58">angular2/src/core/compiler/compiler.ts (line 27)</a>
|
||||
|
||||
:markdown
|
||||
Cache that stores the AppProtoView of the template of a component.
|
||||
|
@ -11,27 +11,12 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3 set
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 clear
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
clear()
|
||||
set(component: Type, protoView: AppProtoView)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -60,12 +45,46 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 set
|
||||
h3 setHost
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
set(component: Type, protoView: AppProtoView)
|
||||
setHost(component: Type, protoView: AppProtoView)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 getHost
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getHost(component: Type)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 clear
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
clear()
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/dynamic_component_loader.ts#L7-L16">angular2/src/core/compiler/dynamic_component_loader.ts (line 7)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/dynamic_component_loader.ts#L7-L16">angular2/src/core/compiler/dynamic_component_loader.ts (line 7)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -13,7 +13,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public location: ElementRef, public instance: any, public dispose: Function)
|
||||
constructor(location: ElementRef, instance: any, dispose: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -22,6 +22,32 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 location
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 instance
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 dispose
|
||||
|
||||
|
@ -47,29 +73,3 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 instance
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 location
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/directive_resolver.ts#L4-L20">angular2/src/core/compiler/directive_resolver.ts (line 4)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/directive_resolver.ts#L4-L20">angular2/src/core/compiler/directive_resolver.ts (line 4)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/dynamic_component_loader.ts#L16-L122">angular2/src/core/compiler/dynamic_component_loader.ts (line 16)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/dynamic_component_loader.ts#L16-L81">angular2/src/core/compiler/dynamic_component_loader.ts (line 16)</a>
|
||||
|
||||
:markdown
|
||||
Service for dynamically loading a Component into an arbitrary position in the internal Angular
|
||||
|
@ -15,7 +15,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(compiler: Compiler, viewManager: AppViewManager)
|
||||
constructor(_compiler: Compiler, _viewManager: AppViewManager)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -30,7 +30,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
loadAsRoot(typeOrBinding, overrideSelector = null, injector: Injector = null)
|
||||
loadAsRoot(typeOrBinding: Type | Binding, overrideSelector?: string, injector?: Injector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -45,17 +45,19 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 loadIntoExistingLocation
|
||||
h3 loadIntoLocation
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
loadIntoExistingLocation(typeOrBinding, location: ElementRef, injector: Injector = null)
|
||||
loadIntoLocation(typeOrBinding: Type | Binding, hostLocation: ElementRef, anchorName: string, injector?: Injector)
|
||||
|
||||
:markdown
|
||||
|
||||
Loads a component into the location given by the provided ElementRef. The loaded component
|
||||
receives injection as if it in the place of the provided ElementRef.
|
||||
Loads a component into the component view of the provided ElementRef
|
||||
next to the element with the given name
|
||||
The loaded component receives
|
||||
injection normally as a hosted view.
|
||||
|
||||
|
||||
|
||||
|
@ -64,32 +66,12 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 loadIntoNewLocation
|
||||
h3 loadNextToLocation
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
loadIntoNewLocation(typeOrBinding, parentComponentLocation: ElementRef, injector: Injector = null)
|
||||
|
||||
:markdown
|
||||
|
||||
Loads a component into a free host view that is not yet attached to
|
||||
a parent on the render side, although it is attached to a parent in the injector hierarchy.
|
||||
The loaded component receives injection normally as a hosted view.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 loadNextToExistingLocation
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
loadNextToExistingLocation(typeOrBinding, location: ElementRef, injector: Injector = null)
|
||||
loadNextToLocation(typeOrBinding: Type | Binding, location: ElementRef, injector?: Injector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/element_ref.ts#L4-L39">angular2/src/core/compiler/element_ref.ts (line 4)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/element_ref.ts#L4-L35">angular2/src/core/compiler/element_ref.ts (line 4)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -22,6 +22,19 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 parentView
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 boundElementIndex
|
||||
|
||||
|
@ -68,16 +81,3 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 parentView
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/core.html">angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/exception_handler.js#L35">angular2/src/core/exception_handler.js (line 35)</a>
|
||||
|
||||
:markdown
|
||||
Provides a hook for centralized exception handling.
|
||||
|
||||
The default implementation of `ExceptionHandler` prints error messages to the `Console`. To intercept error handling,
|
||||
write a custom exception handler that replaces this default as appropriate for your app.
|
||||
|
||||
# Example
|
||||
|
||||
```javascript
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
injectables: [
|
||||
bind(ExceptionHandler).toClass(MyExceptionHandler)
|
||||
]
|
||||
})
|
||||
@View(...)
|
||||
class MyApp { ... }
|
||||
|
||||
|
||||
class MyExceptionHandler implements ExceptionHandler {
|
||||
call(error, stackTrace = null, reason = null) {
|
||||
// do something with the exception
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 call
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
call(error, stackTrace = null, reason = null)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/zone/ng_zone.ts#L4-L213">angular2/src/core/zone/ng_zone.ts (line 4)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/zone/ng_zone.ts#L4-L216">angular2/src/core/zone/ng_zone.ts (line 4)</a>
|
||||
|
||||
:markdown
|
||||
A wrapper around zones that lets you schedule tasks after it has executed a task.
|
||||
|
@ -28,10 +28,6 @@ p.location-badge.
|
|||
- a "root" zone, which the one that instantiated this.
|
||||
- an "inner" zone, which is a child of the root zone.
|
||||
|
||||
@param {bool} enableLongStackTrace whether to enable long stack trace. They should only be
|
||||
enabled in development mode as they significantly impact perf.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -42,23 +38,16 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
initCallbacks({onTurnStart, onTurnDone, onErrorHandler}: {
|
||||
initCallbacks({onTurnStart, onTurnDone, onErrorHandler}?: {
|
||||
onTurnStart?: /*() => void*/ Function,
|
||||
onTurnDone?: /*() => void*/ Function,
|
||||
onErrorHandler?: /*(error, stack) => void*/ Function
|
||||
} = {})
|
||||
})
|
||||
|
||||
:markdown
|
||||
|
||||
Initializes the zone hooks.
|
||||
|
||||
@param {() => void} onTurnStart called before code executes in the inner zone for each VM turn
|
||||
@param {() => void} onTurnDone called at the end of a VM turn if code has executed in the inner
|
||||
zone
|
||||
@param {(error, stack) => void} onErrorHandler called when an exception is thrown by a macro or
|
||||
micro task
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/interfaces.ts#L22-L28">angular2/src/core/compiler/interfaces.ts (line 22)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/interfaces.ts#L27-L33">angular2/src/core/compiler/interfaces.ts (line 27)</a>
|
||||
|
||||
:markdown
|
||||
Defines lifecycle method [onAllChangesDone ] called when the bindings of all its children have
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/interfaces.ts#L1-L7">angular2/src/core/compiler/interfaces.ts (line 1)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/interfaces.ts#L7-L12">angular2/src/core/compiler/interfaces.ts (line 7)</a>
|
||||
|
||||
:markdown
|
||||
Defines lifecycle method [onChange] called after all of component's bound
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/interfaces.ts#L12-L17">angular2/src/core/compiler/interfaces.ts (line 12)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/interfaces.ts#L17-L22">angular2/src/core/compiler/interfaces.ts (line 17)</a>
|
||||
|
||||
:markdown
|
||||
Defines lifecycle method [onCheck] called when a directive is being checked.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/interfaces.ts#L7-L12">angular2/src/core/compiler/interfaces.ts (line 7)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/interfaces.ts#L12-L17">angular2/src/core/compiler/interfaces.ts (line 12)</a>
|
||||
|
||||
:markdown
|
||||
Defines lifecycle method [onDestroy] called when a directive is being destroyed.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/interfaces.ts#L17-L22">angular2/src/core/compiler/interfaces.ts (line 17)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/interfaces.ts#L22-L27">angular2/src/core/compiler/interfaces.ts (line 22)</a>
|
||||
|
||||
:markdown
|
||||
Defines lifecycle method [onInit] called when a directive is being checked the first time.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/visibility.ts#L57-L105">angular2/src/core/annotations_impl/visibility.ts (line 57)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/visibility.ts#L61-L110">angular2/src/core/annotations_impl/visibility.ts (line 61)</a>
|
||||
|
||||
:markdown
|
||||
Specifies that an injector should retrieve a dependency from the direct parent.
|
||||
|
@ -52,7 +52,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor({self}: {self?: boolean} = {})
|
||||
constructor({self}?: {self?: boolean})
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -60,3 +60,20 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 toString
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
toString()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/view_ref.ts#L26-L35">angular2/src/core/compiler/view_ref.ts (line 26)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/view_ref.ts#L24-L31">angular2/src/core/compiler/view_ref.ts (line 24)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -13,7 +13,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(protoView)
|
||||
constructor(_protoView:AppProtoView)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations_impl/di.ts#L44-L56">angular2/src/core/annotations_impl/di.ts (line 44)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/annotations_impl/di.ts#L46-L71">angular2/src/core/annotations_impl/di.ts (line 46)</a>
|
||||
|
||||
:markdown
|
||||
Specifies that a <a href='QueryList-class.html'><code>QueryList</code></a> should be injected.
|
||||
|
@ -16,7 +16,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(public directive: any)
|
||||
constructor(_selector: Type | string, {descendants = false}?: {descendants?: boolean})
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -26,7 +26,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 directive
|
||||
h3 descendants
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -37,3 +37,59 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 selector
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 isVarBindingQuery
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 varBindings
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 toString
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
toString()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/query_list.ts#L1-L86">angular2/src/core/compiler/query_list.ts (line 1)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/core/compiler/query_list.ts#L1-L86">angular2/src/core/compiler/query_list.ts (line 1)</a>
|
||||
|
||||
:markdown
|
||||
An iterable live list of components in the Light DOM.
|
||||
|
@ -38,9 +38,9 @@ p.location-badge.
|
|||
with `<tabs>`
|
||||
component's on `hydrate` and deregister on `dehydrate` event. While a reasonable approach, this
|
||||
would only work
|
||||
partialy since `*ng-for` could rearange the list of `<pane>` components which would not be
|
||||
partialy since `*ng-for` could rearrange the list of `<pane>` components which would not be
|
||||
reported to `<tabs>`
|
||||
component and thus the list of `<pane>` componets would be out of sync with respect to the list
|
||||
component and thus the list of `<pane>` components would be out of sync with respect to the list
|
||||
of `<pane>` elements.
|
||||
|
||||
A preferred solution is to inject a `QueryList` which is a live list of directives in the
|
||||
|
@ -78,6 +78,19 @@ p.location-badge.
|
|||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 T
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 onChange
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue