docs(api): missed files from alpha-32 update

This commit is contained in:
Naomi Black 2015-07-27 22:12:30 -07:00
parent 5588858bcc
commit 488788255d
288 changed files with 20862 additions and 0 deletions

View File

@ -0,0 +1,12 @@
.l-main-section
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/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L365-L365">angular2/src/core/annotations/decorators.ts (line 365)</a>
:markdown
<a href='Attribute-var.html'><code>Attribute</code></a> factory function.

View File

@ -0,0 +1,91 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations_impl/di.ts#L3-L44">angular2/src/core/annotations_impl/di.ts (line 3)</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: string)
:markdown
.l-sub-section
h3 attributeName
:markdown
.l-sub-section
h3 token
:markdown
.l-sub-section
h3 toString
pre.prettyprint
code.
toString()
:markdown

View File

@ -0,0 +1,52 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L241-L292">angular2/src/core/annotations/decorators.ts (line 241)</a>
:markdown
<a href='Attribute-var.html'><code>Attribute</code></a> factory for creating annotations, decorators or DSL.
## Example as TypeScript Decorator
```
import {Attribute, Component, View} from "angular2/angular2";
@Component({...})
@View({...})
class MyComponent {
constructor(@Attribute('title') title: string) {
...
}
}
```
## Example as ES5 DSL
```
var MyComponent = ng
.Component({...})
.View({...})
.Class({
constructor: [new ng.Attribute('title'), function(title) {
...
}]
})
```
## Example as ES5 annotation
```
var MyComponent = function(title) {
...
};
MyComponent.annotations = [
new ng.Component({...})
new ng.View({...})
]
MyComponent.parameters = [
[new ng.Attribute('title')]
]
```

View File

@ -0,0 +1,98 @@
.l-main-section
h2(class="function export") Class
pre.prettyprint
code.
Class(clsDef: ClassDefinition) : Type
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/util/decorators.ts#L124-L231">angular2/src/util/decorators.ts (line 124)</a>
:markdown
Provides a way for expressing ES6 classes with parameter annotations in ES5.
## Basic Example
```
var Greeter = ng.Class({
constructor: function(name) {
this.name = name;
},
greet: function() {
alert('Hello ' + this.name + '!');
}
});
```
is equivalent to ES6:
```
class Greeter {
constructor(name) {
this.name = name;
}
greet() {
alert('Hello ' + this.name + '!');
}
}
```
or equivalent to ES5:
```
var Greeter = function (name) {
this.name = name;
}
Greeter.prototype.greet = function () {
alert('Hello ' + this.name + '!');
}
```
## Example with parameter annotations
```
var MyService = neg.Class({
constructor: [String, [new Query(), QueryList], function(name, queryList) {
...
}];
});
```
is equivalent to ES6:
```
class MyService {
constructor(name: string, @Query() queryList: QueryList) {
...
}
}
```
## Example with inheritance
```
var Shape = ng.Class({
constructor: (color) {
this.color = color;
}
});
var Square = ng.Class({
extends: Shape,
constructor: function(color, size) {
Shape.call(this, color);
this.size = size;
}
});
```

View File

@ -0,0 +1,44 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/util/decorators.ts#L1-L22">angular2/src/util/decorators.ts (line 1)</a>
:markdown
Declares the interface to be used with <a href='Class-function.html'><code>Class</code></a>.
.l-main-section
h2 Members
.l-sub-section
h3 extends?
:markdown
Optional argument for specifying the superclass.
.l-sub-section
h3 constructor
:markdown
Required constructor function for a class.
The function may be optionally wrapped in an `Array`, in which case additional parameter
annotations may be specified.
The number of arguments and the number of parameter annotations must match.
See <a href='Class-function.html'><code>Class</code></a> for example of usage.

View File

@ -0,0 +1,12 @@
.l-main-section
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/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L349-L350">angular2/src/core/annotations/decorators.ts (line 349)</a>
:markdown
<a href='Component-var.html'><code>Component</code></a> factory function.

View File

@ -0,0 +1,142 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations_impl/annotations.ts#L782-L904">angular2/src/core/annotations_impl/annotations.ts (line 782)</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 all the injectable objects configured with `hostInjector` and `viewInjector`.
All template expressions and statements are then evaluated against the component instance.
For details on the `@View` annotation, see <a href='View-var.html'><code>View</code></a>.
## Example
```
@Component({
selector: 'greet'
})
@View({
template: 'Hello {{name}}!'
})
class Greet {
name: string;
constructor() {
this.name = 'World';
}
}
```
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor({selector, properties, events, host, exportAs, lifecycle, hostInjector, viewInjector,
changeDetection = DEFAULT, compileChildren = true}?: {
selector?: string,
properties?: List&lt;string&gt;,
events?: List&lt;string&gt;,
host?: StringMap&lt;string, string&gt;,
lifecycle?: List&lt;LifecycleEvent&gt;,
hostInjector?: List&lt;any&gt;,
exportAs?: string,
compileChildren?: boolean,
viewInjector?: List&lt;any&gt;,
changeDetection?: string,
})
: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 viewInjector
:markdown
Defines the set of injectable objects that are visible to its view 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: 'needs-greeter'
})
class NeedsGreeter {
greeter:Greeter;
constructor(greeter:Greeter) {
this.greeter = greeter;
}
}
@Component({
selector: 'greet',
viewInjector: [
Greeter
]
})
@View({
template: `<needs-greeter></needs-greeter>`,
directives: [NeedsGreeter]
})
class HelloWorld {
}
```

View File

@ -0,0 +1,37 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L18-L37">angular2/src/core/annotations/decorators.ts (line 18)</a>
:markdown
Interface for the <a href='Component-var.html'><code>Component</code></a> decorator function.
See <a href='ComponentFactory-interface.html'><code>ComponentFactory</code></a>.
.l-main-section
h2 Members
.l-sub-section
h3 View
pre.prettyprint
code.
View(obj: {
templateUrl?: string,
template?: string,
directives?: List&lt;Type | any | List&lt;any&gt;&gt;,
renderer?: string,
styles?: List&lt;string&gt;,
styleUrls?: List&lt;string&gt;,
})
:markdown
Chain <a href='View-var.html'><code>View</code></a> annotation.

View File

@ -0,0 +1,49 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L109-L179">angular2/src/core/annotations/decorators.ts (line 109)</a>
:markdown
<a href='ComponentAnnotation-class.html'><code>ComponentAnnotation</code></a> factory for creating annotations, decorators or DSL.
## Example as TypeScript Decorator
```
import {Component, View} from "angular2/angular2";
@Component({...})
@View({...})
class MyComponent {
constructor() {
...
}
}
```
## Example as ES5 DSL
```
var MyComponent = ng
.Component({...})
.View({...})
.Class({
constructor: function() {
...
}
})
```
## Example as ES5 annotation
```
var MyComponent = function() {
...
};
MyComponent.annotations = [
new ng.Component({...})
new ng.View({...})
]
```

View File

@ -0,0 +1,12 @@
.l-main-section
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/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L354-L354">angular2/src/core/annotations/decorators.ts (line 354)</a>
:markdown
<a href='Directive-var.html'><code>Directive</code></a> factory function.

View File

@ -0,0 +1,853 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations_impl/annotations.ts#L4-L782">angular2/src/core/annotations_impl/annotations.ts (line 4)</a>
:markdown
Directives allow you to attach behavior to elements in the DOM.
<a href='Directive-var.html'><code>Directive</code></a>s with an embedded view are called <a href='Component-var.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 instance has its own <a href='../di/Injector-class.html'><code>Injector</code></a>, and they follow
the same parent-child hierarchy
as the component instances in the DOM.
- *Element Injectors*: Each component instance 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-var.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.
- `@Query(DirectiveType) query:QueryList<DirectiveType>`: A live collection of direct child
directives.
- `@QueryDescendants(DirectiveType) query:QueryList<DirectiveType>`: A live collection of any
child directives.
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-var.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 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);
}
}
```
`@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='../core/QueryList-class.html'><code>QueryList</code></a>, which updates its contents as children are added,
removed, or moved by a directive that uses a <a href='../core/ViewContainerRef-class.html'><code>ViewContainerRef</code></a> such as a `ng-for`, an
`ng-if`, or an `ng-switch`.
```
@Directive({ selector: '[my-directive]' })
class MyDirective {
constructor(@Query(Dependency) dependencies:QueryList<Dependency>) {
}
}
```
This directive would be instantiated with a <a href='../core/QueryList-class.html'><code>QueryList</code></a> which contains `Dependency` 4 and
6. Here, `Dependency` 5 would not be included, because it is not a direct child.
### Injecting a live collection of descendant directives
By passing the descendant flag to `@Query` above, we can include the children of the child
elements.
```
@Directive({ selector: '[my-directive]' })
class MyDirective {
constructor(@Query(Dependency, {descendants: true}) dependencies:QueryList<Dependency>) {
}
}
```
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-var.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']
})
export class Unless {
viewContainer: ViewContainerRef;
templateRef: TemplateRef;
prevCondition: boolean;
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef) {
this.viewContainer = viewContainer;
this.templateRef = templateRef;
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.templateRef);
}
}
}
```
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, host, lifecycle, hostInjector, exportAs,
compileChildren = true,
}?: {
selector?: string,
properties?: List&lt;string&gt;,
events?: List&lt;string&gt;,
host?: StringMap&lt;string, string&gt;,
lifecycle?: List&lt;LifecycleEvent&gt;,
hostInjector?: List&lt;any&gt;,
exportAs?: string,
compileChildren?: boolean,
})
:markdown
.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.
.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`
configuration:
- `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='../change_detection/Pipe-interface.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
There is no need to specify both `directiveProperty` and `bindingProperty` when they both have
the same value.
```
@Directive({
properties: [
'propertyName', // shorthand notation for 'propertyName: propertyName'
'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(value: string) {
// This will get called every time with the new value when the 'tooltip' property changes
}
}
```
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='../change_detection/Pipe-interface.html'><code>Pipe</code></a> and <a href='../pipes/KeyValueChanges-class.html'><code>KeyValueChanges</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 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');
}
}
```
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='LifecycleEvent-enum.html'><code>LifecycleEvent</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 {
}
```

View File

@ -0,0 +1,11 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L11-L18">angular2/src/core/annotations/decorators.ts (line 11)</a>
:markdown
Interface for the <a href='Directive-var.html'><code>Directive</code></a> decorator function.
See <a href='DirectiveFactory-interface.html'><code>DirectiveFactory</code></a>.

View File

@ -0,0 +1,46 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L56-L109">angular2/src/core/annotations/decorators.ts (line 56)</a>
:markdown
<a href='Directive-var.html'><code>Directive</code></a> factory for creating annotations, decorators or DSL.
## Example as TypeScript Decorator
```
import {Directive} from "angular2/angular2";
@Directive({...})
class MyDirective {
constructor() {
...
}
}
```
## Example as ES5 DSL
```
var MyDirective = ng
.Directive({...})
.Class({
constructor: function() {
...
}
})
```
## Example as ES5 annotation
```
var MyDirective = function() {
...
};
MyDirective.annotations = [
new ng.Directive({...})
]
```

View File

@ -0,0 +1,13 @@
<h1>angular2/annotations/LifecycleEvent</h1>
<h2>(enum)</h2>
<div>
<p>Lifecycle events are guaranteed to be called in the following order:</p>
<ul>
<li><code>onChange</code> (optional if any bindings have changed),</li>
<li><code>onInit</code> (optional after the first check only),</li>
<li><code>onCheck</code>,</li>
<li><code>onAllChangesDone</code></li>
</ul>
</div>

View File

@ -0,0 +1,28 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/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
been changed.
.l-main-section
h2 Members
.l-sub-section
h3 onAllChangesDone
pre.prettyprint
code.
onAllChangesDone()
:markdown

View File

@ -0,0 +1,28 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/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
properties are updated.
.l-main-section
h2 Members
.l-sub-section
h3 onChange
pre.prettyprint
code.
onChange(changes: StringMap&lt;string, any&gt;)
:markdown

View File

@ -0,0 +1,27 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/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.
.l-main-section
h2 Members
.l-sub-section
h3 onCheck
pre.prettyprint
code.
onCheck()
:markdown

View File

@ -0,0 +1,27 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/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.
.l-main-section
h2 Members
.l-sub-section
h3 onDestroy
pre.prettyprint
code.
onDestroy()
:markdown

View File

@ -0,0 +1,27 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/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.
.l-main-section
h2 Members
.l-sub-section
h3 onInit
pre.prettyprint
code.
onInit()
:markdown

View File

@ -0,0 +1,10 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/util/decorators.ts#L63-L74">angular2/src/util/decorators.ts (line 63)</a>
:markdown
An interface implemented by all Angular parameter decorators, which allows them to be used as ES7
decorators.

View File

@ -0,0 +1,12 @@
.l-main-section
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/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L370-L370">angular2/src/core/annotations/decorators.ts (line 370)</a>
:markdown
<a href='Query-var.html'><code>Query</code></a> factory function.

View File

@ -0,0 +1,109 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations_impl/di.ts#L44-L69">angular2/src/core/annotations_impl/di.ts (line 44)</a>
:markdown
Specifies that a <a href='../core/QueryList-class.html'><code>QueryList</code></a> should be injected.
See <a href='../core/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(_selector: Type | string, {descendants = false}?: {descendants?: boolean})
:markdown
.l-sub-section
h3 descendants
:markdown
.l-sub-section
h3 isViewQuery
:markdown
.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

View File

@ -0,0 +1,52 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L292-L343">angular2/src/core/annotations/decorators.ts (line 292)</a>
:markdown
<a href='Query-var.html'><code>Query</code></a> factory for creating annotations, decorators or DSL.
## Example as TypeScript Decorator
```
import {Query, QueryList, Component, View} from "angular2/angular2";
@Component({...})
@View({...})
class MyComponent {
constructor(@Query(SomeType) queryList: QueryList) {
...
}
}
```
## Example as ES5 DSL
```
var MyComponent = ng
.Component({...})
.View({...})
.Class({
constructor: [new ng.Query(SomeType), function(queryList) {
...
}]
})
```
## Example as ES5 annotation
```
var MyComponent = function(queryList) {
...
};
MyComponent.annotations = [
new ng.Component({...})
new ng.View({...})
]
MyComponent.parameters = [
[new ng.Query(SomeType)]
]
```

View File

@ -0,0 +1,63 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/util/decorators.ts#L22-L63">angular2/src/util/decorators.ts (line 22)</a>
:markdown
An interface implemented by all Angular type decorators, which allows them to be used as ES7
decorators as well as
Angular DSL syntax.
DSL syntax:
```
var MyClass = ng
.Component({...})
.View({...})
.Class({...});
```
ES7 syntax:
```
@ng.Component({...})
@ng.View({...})
class MyClass {...}
```
.l-main-section
h2 Members
.l-sub-section
h3 annotations
:markdown
Storage for the accumulated annotations so far used by the DSL syntax.
Used by <a href='Class-function.html'><code>Class</code></a> to annotate the generated class.
.l-sub-section
h3 Class
pre.prettyprint
code.
Class(obj: ClassDefinition)
:markdown
Generate a class from the definition and annotate it with <a href='TypeDecorator-interface.html#annotations'><code>TypeDecorator</code></a>.

View File

@ -0,0 +1,12 @@
.l-main-section
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/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L359-L360">angular2/src/core/annotations/decorators.ts (line 359)</a>
:markdown
<a href='View-var.html'><code>View</code></a> factory function.

View File

@ -0,0 +1,169 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations_impl/view.ts#L1-L109">angular2/src/core/annotations_impl/view.ts (line 1)</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-var.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, styles, styleUrls}?: {
templateUrl?: string,
template?: string,
directives?: List&lt;Type | any | List&lt;any&gt;&gt;,
renderer?: string,
styles?: List&lt;string&gt;,
styleUrls?: List&lt;string&gt;,
})
:markdown
.l-sub-section
h3 templateUrl
:markdown
Specifies an inline template for an angular component.
NOTE: either `templateUrl` or `template` should be used, but not both.
.l-sub-section
h3 template
:markdown
Specifies a template URL for an angular component.
NOTE: either `templateUrl` or `template` should be used, but not both.
.l-sub-section
h3 styleUrls
:markdown
Specifies stylesheet URLs for an angular component.
.l-sub-section
h3 styles
:markdown
Specifies an inline stylesheet for an angular component.
.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 *ng-for="#item of 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`, `styles`, `styleUrls` nor `directives` are
used.

View File

@ -0,0 +1,37 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L37-L56">angular2/src/core/annotations/decorators.ts (line 37)</a>
:markdown
Interface for the <a href='View-var.html'><code>View</code></a> decorator function.
See <a href='ViewFactory-interface.html'><code>ViewFactory</code></a>.
.l-main-section
h2 Members
.l-sub-section
h3 View
pre.prettyprint
code.
View(obj: {
templateUrl?: string,
template?: string,
directives?: List&lt;Type | any | List&lt;any&gt;&gt;,
renderer?: string,
styles?: List&lt;string&gt;,
styleUrls?: List&lt;string&gt;,
})
:markdown
Chain <a href='View-var.html'><code>View</code></a> annotation.

View File

@ -0,0 +1,49 @@
p.location-badge.
exported from <a href='../annotations'>angular2/annotations</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L179-L241">angular2/src/core/annotations/decorators.ts (line 179)</a>
:markdown
<a href='ViewAnnotation-class.html'><code>ViewAnnotation</code></a> factory for creating annotations, decorators or DSL.
## Example as TypeScript Decorator
```
import {Component, View} from "angular2/angular2";
@Component({...})
@View({...})
class MyComponent {
constructor() {
...
}
}
```
## Example as ES5 DSL
```
var MyComponent = ng
.Component({...})
.View({...})
.Class({
constructor: function() {
...
}
})
```
## Example as ES5 annotation
```
var MyComponent = function() {
...
};
MyComponent.annotations = [
new ng.Component({...})
new ng.View({...})
]
```

View File

@ -0,0 +1,12 @@
.l-main-section
h2 ViewQuery <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/2.0.0-alpha.32/modules/angular2/src/core/annotations/decorators.ts#L376-L376">angular2/src/core/annotations/decorators.ts (line 376)</a>
:markdown
<a href='ViewQuery-var.html'><code>ViewQuery</code></a> factory function.

View File

@ -0,0 +1,122 @@
{
"index" : {
"title" : "Annotations",
"intro" : "Annotations provide the additional information that Angular requires in order to run yourapplication. This modulecontains <a href='Component-var.html'><code>Component</code></a>, <a href='Directive-var.html'><code>Directive</code></a>, and <a href='View-var.html'><code>View</code></a> annotations, as well asthe <a href='../di/Ancestor-var.html'><code>Ancestor</code></a> annotation that is used by Angular to resolve dependencies."
},
"ComponentAnnotation-class" : {
"title" : "ComponentAnnotation Class"
},
"DirectiveAnnotation-class" : {
"title" : "DirectiveAnnotation Class"
},
"LifecycleEvent-enum" : {
"title" : "LifecycleEvent Enum"
},
"ViewAnnotation-class" : {
"title" : "ViewAnnotation Class"
},
"QueryAnnotation-class" : {
"title" : "QueryAnnotation Class"
},
"AttributeAnnotation-class" : {
"title" : "AttributeAnnotation Class"
},
"OnAllChangesDone-interface" : {
"title" : "OnAllChangesDone Interface"
},
"OnChange-interface" : {
"title" : "OnChange Interface"
},
"OnDestroy-interface" : {
"title" : "OnDestroy Interface"
},
"OnInit-interface" : {
"title" : "OnInit Interface"
},
"OnCheck-interface" : {
"title" : "OnCheck Interface"
},
"Class-function" : {
"title" : "Class Function"
},
"ClassDefinition-interface" : {
"title" : "ClassDefinition Interface"
},
"ParameterDecorator-interface" : {
"title" : "ParameterDecorator Interface"
},
"TypeDecorator-interface" : {
"title" : "TypeDecorator Interface"
},
"Attribute-var" : {
"title" : "Attribute Var"
},
"AttributeFactory-interface" : {
"title" : "AttributeFactory Interface"
},
"Component-var" : {
"title" : "Component Var"
},
"ComponentDecorator-interface" : {
"title" : "ComponentDecorator Interface"
},
"ComponentFactory-interface" : {
"title" : "ComponentFactory Interface"
},
"Directive-var" : {
"title" : "Directive Var"
},
"DirectiveDecorator-interface" : {
"title" : "DirectiveDecorator Interface"
},
"DirectiveFactory-interface" : {
"title" : "DirectiveFactory Interface"
},
"View-var" : {
"title" : "View Var"
},
"ViewDecorator-interface" : {
"title" : "ViewDecorator Interface"
},
"ViewFactory-interface" : {
"title" : "ViewFactory Interface"
},
"Query-var" : {
"title" : "Query Var"
},
"QueryFactory-interface" : {
"title" : "QueryFactory Interface"
},
"ViewQuery-var" : {
"title" : "ViewQuery Var"
}
}

View File

@ -0,0 +1,11 @@
p.location-badge.
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/annotations.ts#L1-L53">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
if slug != 'index'
url = "/docs/" + current.path[1] + "/" + current.path[2] + "/" + current.path[3] + "/" + current.path[4] + "/" + slug + ".html"
li.c8
!= partial("../../../../../_includes/_hover-card", {name: page.title, url: url })

View File

@ -0,0 +1,90 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/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 eval
pre.prettyprint
code.
eval(context: any, locals: Locals)
:markdown
.l-sub-section
h3 isAssignable
:markdown
.l-sub-section
h3 assign
pre.prettyprint
code.
assign(context: any, locals: Locals, value: any)
:markdown
.l-sub-section
h3 visit
pre.prettyprint
code.
visit(visitor: AstVisitor)
:markdown
.l-sub-section
h3 toString
pre.prettyprint
code.
toString()
:markdown

View File

@ -0,0 +1,144 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/parser/ast.ts#L310-L326">angular2/src/change_detection/parser/ast.ts (line 310)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(ast: AST, source: string, location: string)
:markdown
.l-sub-section
h3 ast
:markdown
.l-sub-section
h3 source
:markdown
.l-sub-section
h3 location
:markdown
.l-sub-section
h3 eval
pre.prettyprint
code.
eval(context: any, locals: Locals)
:markdown
.l-sub-section
h3 isAssignable
:markdown
.l-sub-section
h3 assign
pre.prettyprint
code.
assign(context: any, locals: Locals, value: any)
:markdown
.l-sub-section
h3 visit
pre.prettyprint
code.
visit(visitor: AstVisitor)
:markdown
.l-sub-section
h3 toString
pre.prettyprint
code.
toString()
:markdown

View File

@ -0,0 +1,140 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/parser/ast.ts#L75-L107">angular2/src/change_detection/parser/ast.ts (line 75)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(receiver: AST, name: string, getter: Function, setter: Function)
:markdown
.l-sub-section
h3 receiver
:markdown
.l-sub-section
h3 name
:markdown
.l-sub-section
h3 getter
:markdown
.l-sub-section
h3 setter
:markdown
.l-sub-section
h3 eval
pre.prettyprint
code.
eval(context: any, locals: Locals)
:markdown
.l-sub-section
h3 isAssignable
:markdown
.l-sub-section
h3 assign
pre.prettyprint
code.
assign(context: any, locals: Locals, value: any)
:markdown
.l-sub-section
h3 visit
pre.prettyprint
code.
visit(visitor: AstVisitor)
:markdown

View File

@ -0,0 +1,332 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/parser/ast.ts#L352-L430">angular2/src/change_detection/parser/ast.ts (line 352)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 visitImplicitReceiver
pre.prettyprint
code.
visitImplicitReceiver(ast: ImplicitReceiver)
:markdown
.l-sub-section
h3 visitInterpolation
pre.prettyprint
code.
visitInterpolation(ast: Interpolation)
:markdown
.l-sub-section
h3 visitLiteralPrimitive
pre.prettyprint
code.
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
.l-sub-section
h3 visitLiteralArray
pre.prettyprint
code.
visitLiteralArray(ast: LiteralArray)
:markdown
.l-sub-section
h3 visitLiteralMap
pre.prettyprint
code.
visitLiteralMap(ast: LiteralMap)
:markdown
.l-sub-section
h3 visitBinary
pre.prettyprint
code.
visitBinary(ast: Binary)
:markdown
.l-sub-section
h3 visitPrefixNot
pre.prettyprint
code.
visitPrefixNot(ast: PrefixNot)
:markdown
.l-sub-section
h3 visitConditional
pre.prettyprint
code.
visitConditional(ast: Conditional)
:markdown
.l-sub-section
h3 visitPipe
pre.prettyprint
code.
visitPipe(ast: BindingPipe)
:markdown
.l-sub-section
h3 visitKeyedAccess
pre.prettyprint
code.
visitKeyedAccess(ast: KeyedAccess)
:markdown
.l-sub-section
h3 visitAll
pre.prettyprint
code.
visitAll(asts: List&lt;any&gt;)
: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

View File

@ -0,0 +1,71 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/pipes/pipe.ts#L55-L75">angular2/src/change_detection/pipes/pipe.ts (line 55)</a>
:markdown
Provides default implementation of supports and onDestroy.
#Example
```
class DoublePipe extends BasePipe {*
transform(value) {
return `${value}${value}`;
}
}
```
.l-main-section
h2 Members
.l-sub-section
h3 supports
pre.prettyprint
code.
supports(obj: any)
:markdown
.l-sub-section
h3 onDestroy
pre.prettyprint
code.
onDestroy()
:markdown
.l-sub-section
h3 transform
pre.prettyprint
code.
transform(value: any, args: List&lt;any&gt;)
:markdown

View File

@ -0,0 +1,294 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/binding_record.ts#L12-L113">angular2/src/change_detection/binding_record.ts (line 12)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(mode: string, implicitReceiver: any, ast: AST, elementIndex: number, propertyName: string, propertyUnit: string, setter: SetterFn, lifecycleEvent: string, directiveRecord: DirectiveRecord)
:markdown
.l-sub-section
h3 mode
:markdown
.l-sub-section
h3 implicitReceiver
:markdown
.l-sub-section
h3 ast
:markdown
.l-sub-section
h3 elementIndex
:markdown
.l-sub-section
h3 propertyName
:markdown
.l-sub-section
h3 propertyUnit
:markdown
.l-sub-section
h3 setter
:markdown
.l-sub-section
h3 lifecycleEvent
:markdown
.l-sub-section
h3 directiveRecord
:markdown
.l-sub-section
h3 callOnChange
pre.prettyprint
code.
callOnChange()
:markdown
.l-sub-section
h3 isOnPushChangeDetection
pre.prettyprint
code.
isOnPushChangeDetection()
:markdown
.l-sub-section
h3 isDirective
pre.prettyprint
code.
isDirective()
:markdown
.l-sub-section
h3 isDirectiveLifecycle
pre.prettyprint
code.
isDirectiveLifecycle()
:markdown
.l-sub-section
h3 isElementProperty
pre.prettyprint
code.
isElementProperty()
:markdown
.l-sub-section
h3 isElementAttribute
pre.prettyprint
code.
isElementAttribute()
:markdown
.l-sub-section
h3 isElementClass
pre.prettyprint
code.
isElementClass()
:markdown
.l-sub-section
h3 isElementStyle
pre.prettyprint
code.
isElementStyle()
:markdown
.l-sub-section
h3 isTextNode
pre.prettyprint
code.
isTextNode()
:markdown

View File

@ -0,0 +1,13 @@
.l-main-section
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/2.0.0-alpha.32/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
CHECK_ONCE or CHECK_ALWAYS.

View File

@ -0,0 +1,13 @@
.l-main-section
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/2.0.0-alpha.32/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
will remain CHECK_ALWAYS.

View File

@ -0,0 +1,13 @@
.l-main-section
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/2.0.0-alpha.32/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
will become CHECKED.

View File

@ -0,0 +1,49 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/interfaces.ts#L5-L37">angular2/src/change_detection/interfaces.ts (line 5)</a>
:markdown
Interface used by Angular to control the change detection strategy for an application.
Angular implements the following change detection strategies by default:
- <a href='DynamicChangeDetection-class.html'><code>DynamicChangeDetection</code></a>: slower, but does not require `eval()`.
- <a href='JitChangeDetection-class.html'><code>JitChangeDetection</code></a>: faster, but requires `eval()`.
In JavaScript, you should always use `JitChangeDetection`, unless you are in an environment that
has
[CSP](https://developer.mozilla.org/en-US/docs/Web/Security/CSP), such as a Chrome Extension.
In Dart, use `DynamicChangeDetection` during development. The Angular transformer generates an
analog to the
`JitChangeDetection` strategy at compile time.
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
bootstrap(MyApp, [bind(ChangeDetection).toClass(DynamicChangeDetection)]);
```
.l-main-section
h2 Members
.l-sub-section
h3 createProtoChangeDetector
pre.prettyprint
code.
createProtoChangeDetector(definition: ChangeDetectorDefinition)
:markdown

View File

@ -0,0 +1,37 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/exceptions.ts#L9-L19">angular2/src/change_detection/exceptions.ts (line 9)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(proto: ProtoRecord, originalException: any, originalStack: any)
:markdown
.l-sub-section
h3 location
:markdown

View File

@ -0,0 +1,205 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/interfaces.ts#L42-L59">angular2/src/change_detection/interfaces.ts (line 42)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 parent
:markdown
.l-sub-section
h3 mode
:markdown
.l-sub-section
h3 addChild
pre.prettyprint
code.
addChild(cd: ChangeDetector)
:markdown
.l-sub-section
h3 addShadowDomChild
pre.prettyprint
code.
addShadowDomChild(cd: ChangeDetector)
:markdown
.l-sub-section
h3 removeChild
pre.prettyprint
code.
removeChild(cd: ChangeDetector)
:markdown
.l-sub-section
h3 removeShadowDomChild
pre.prettyprint
code.
removeShadowDomChild(cd: ChangeDetector)
:markdown
.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, pipes: 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

View File

@ -0,0 +1,89 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/interfaces.ts#L61-L67">angular2/src/change_detection/interfaces.ts (line 61)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(id: string, strategy: string, variableNames: List&lt;string&gt;, bindingRecords: List&lt;BindingRecord&gt;, directiveRecords: List&lt;DirectiveRecord&gt;)
:markdown
.l-sub-section
h3 id
:markdown
.l-sub-section
h3 strategy
:markdown
.l-sub-section
h3 variableNames
:markdown
.l-sub-section
h3 bindingRecords
:markdown
.l-sub-section
h3 directiveRecords
:markdown

View File

@ -0,0 +1,89 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/change_detector_ref.ts#L2-L37">angular2/src/change_detection/change_detector_ref.ts (line 2)</a>
:markdown
Controls change detection.
<a href='ChangeDetectorRef-class.html'><code>ChangeDetectorRef</code></a> allows requesting checks for detectors that rely on observables. It
also allows detaching and
attaching change detector subtrees.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(_cd: ChangeDetector)
:markdown
.l-sub-section
h3 requestCheck
pre.prettyprint
code.
requestCheck()
:markdown
Request to check all ON_PUSH ancestors.
.l-sub-section
h3 detach
pre.prettyprint
code.
detach()
:markdown
Detaches the change detector from the change detector tree.
The detached change detector will not be checked until it is reattached.
.l-sub-section
h3 reattach
pre.prettyprint
code.
reattach()
:markdown
Reattach the change detector to the change detector tree.
This also requests a check of this change detector. This reattached change detector will be
checked during the
next change detection run.

View File

@ -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/2.0.0-alpha.32/modules/angular2/src/change_detection/interfaces.ts#L37-L42">angular2/src/change_detection/interfaces.ts (line 37)</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

View File

@ -0,0 +1,12 @@
.l-main-section
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/2.0.0-alpha.32/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.

View File

@ -0,0 +1,13 @@
.l-main-section
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/2.0.0-alpha.32/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
should be skipped.

View File

@ -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/2.0.0-alpha.32/modules/angular2/src/change_detection/exceptions.ts#L19-L23">angular2/src/change_detection/exceptions.ts (line 19)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor()
:markdown

View File

@ -0,0 +1,63 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/directive_record.ts#L2-L8">angular2/src/change_detection/directive_record.ts (line 2)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(elementIndex: number, directiveIndex: number)
:markdown
.l-sub-section
h3 elementIndex
:markdown
.l-sub-section
h3 directiveIndex
:markdown
.l-sub-section
h3 name
:markdown

View File

@ -0,0 +1,127 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/directive_record.ts#L8-L36">angular2/src/change_detection/directive_record.ts (line 8)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor({directiveIndex, callOnAllChangesDone, callOnChange, callOnCheck, callOnInit,
changeDetection}?: {
directiveIndex?: DirectiveIndex,
callOnAllChangesDone?: boolean,
callOnChange?: boolean,
callOnCheck?: boolean,
callOnInit?: boolean,
changeDetection?: string
})
:markdown
.l-sub-section
h3 directiveIndex
:markdown
.l-sub-section
h3 callOnAllChangesDone
:markdown
.l-sub-section
h3 callOnChange
:markdown
.l-sub-section
h3 callOnCheck
:markdown
.l-sub-section
h3 callOnInit
:markdown
.l-sub-section
h3 changeDetection
:markdown
.l-sub-section
h3 isOnPushChangeDetection
pre.prettyprint
code.
isOnPushChangeDetection()
:markdown

View File

@ -0,0 +1,29 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/change_detection.ts#L143-L156">angular2/src/change_detection/change_detection.ts (line 143)</a>
:markdown
Implements change detection that does not require `eval()`.
This is slower than <a href='JitChangeDetection-class.html'><code>JitChangeDetection</code></a>.
.l-main-section
h2 Members
.l-sub-section
h3 createProtoChangeDetector
pre.prettyprint
code.
createProtoChangeDetector(definition: ChangeDetectorDefinition)
:markdown

View File

@ -0,0 +1,265 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/dynamic_change_detector.ts#L11-L320">angular2/src/change_detection/dynamic_change_detector.ts (line 11)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(id: string, changeControlStrategy: string, dispatcher: any, protos: List&lt;ProtoRecord&gt;, directiveRecords: List&lt;any&gt;)
:markdown
.l-sub-section
h3 locals
:markdown
.l-sub-section
h3 values
:markdown
.l-sub-section
h3 changes
:markdown
.l-sub-section
h3 localPipes
:markdown
.l-sub-section
h3 prevContexts
:markdown
.l-sub-section
h3 directives
:markdown
.l-sub-section
h3 alreadyChecked
:markdown
.l-sub-section
h3 pipes
:markdown
.l-sub-section
h3 changeControlStrategy
:markdown
.l-sub-section
h3 dispatcher
:markdown
.l-sub-section
h3 protos
:markdown
.l-sub-section
h3 directiveRecords
:markdown
.l-sub-section
h3 hydrate
pre.prettyprint
code.
hydrate(context: any, locals: Locals, directives: any, pipes: Pipes)
: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

View File

@ -0,0 +1,54 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/proto_change_detector.ts#L36-L56">angular2/src/change_detection/proto_change_detector.ts (line 36)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(definition: ChangeDetectorDefinition)
:markdown
.l-sub-section
h3 definition
:markdown
.l-sub-section
h3 instantiate
pre.prettyprint
code.
instantiate(dispatcher: any)
:markdown

View File

@ -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/2.0.0-alpha.32/modules/angular2/src/change_detection/exceptions.ts#L2-L9">angular2/src/change_detection/exceptions.ts (line 2)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(proto: ProtoRecord, change: any)
:markdown

View File

@ -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/2.0.0-alpha.32/modules/angular2/src/change_detection/parser/ast.ts#L23-L29">angular2/src/change_detection/parser/ast.ts (line 23)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 eval
pre.prettyprint
code.
eval(context: any, locals: Locals)
:markdown
.l-sub-section
h3 visit
pre.prettyprint
code.
visit(visitor: AstVisitor)
:markdown

View File

@ -0,0 +1,30 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/change_detection.ts#L156-L172">angular2/src/change_detection/change_detection.ts (line 156)</a>
:markdown
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> and <a href='PreGeneratedChangeDetection-class.html'><code>PreGeneratedChangeDetection</code></a>.
.l-main-section
h2 Members
.l-sub-section
h3 createProtoChangeDetector
pre.prettyprint
code.
createProtoChangeDetector(definition: ChangeDetectorDefinition)
:markdown

View File

@ -0,0 +1,26 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/parser/lexer.ts#L18-L32">angular2/src/change_detection/parser/lexer.ts (line 18)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 tokenize
pre.prettyprint
code.
tokenize(text: string)
:markdown

View File

@ -0,0 +1,71 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/parser/ast.ts#L156-L166">angular2/src/change_detection/parser/ast.ts (line 156)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(expressions: List&lt;any&gt;)
:markdown
.l-sub-section
h3 expressions
:markdown
.l-sub-section
h3 eval
pre.prettyprint
code.
eval(context: any, locals: Locals)
:markdown
.l-sub-section
h3 visit
pre.prettyprint
code.
visit(visitor: AstVisitor)
:markdown

View File

@ -0,0 +1,118 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/parser/locals.ts#L2-L44">angular2/src/change_detection/parser/locals.ts (line 2)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(parent: Locals, current: Map&lt;any, any&gt;)
:markdown
.l-sub-section
h3 parent
:markdown
.l-sub-section
h3 current
:markdown
.l-sub-section
h3 contains
pre.prettyprint
code.
contains(name: string)
:markdown
.l-sub-section
h3 get
pre.prettyprint
code.
get(name: string)
:markdown
.l-sub-section
h3 set
pre.prettyprint
code.
set(name: string, value: any)
:markdown
.l-sub-section
h3 clearValues
pre.prettyprint
code.
clearValues()
:markdown

View File

@ -0,0 +1,56 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/pipes/null_pipe.ts#L10-L27">angular2/src/change_detection/pipes/null_pipe.ts (line 10)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 called
:markdown
.l-sub-section
h3 supports
pre.prettyprint
code.
supports(obj: any)
:markdown
.l-sub-section
h3 transform
pre.prettyprint
code.
transform(value: any, args?: List&lt;any&gt;)
:markdown

View File

@ -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/2.0.0-alpha.32/modules/angular2/src/change_detection/pipes/null_pipe.ts#L3-L10">angular2/src/change_detection/pipes/null_pipe.ts (line 3)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 supports
pre.prettyprint
code.
supports(obj: any)
:markdown
.l-sub-section
h3 create
pre.prettyprint
code.
create(cdRef: ChangeDetectorRef)
:markdown

View File

@ -0,0 +1,12 @@
.l-main-section
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/2.0.0-alpha.32/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.

View File

@ -0,0 +1,126 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/parser/parser.ts#L49-L107">angular2/src/change_detection/parser/parser.ts (line 49)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(_lexer: Lexer, providedReflector?: Reflector)
:markdown
.l-sub-section
h3 parseAction
pre.prettyprint
code.
parseAction(input: string, location: any)
:markdown
.l-sub-section
h3 parseBinding
pre.prettyprint
code.
parseBinding(input: string, location: any)
:markdown
.l-sub-section
h3 parseSimpleBinding
pre.prettyprint
code.
parseSimpleBinding(input: string, location: string)
:markdown
.l-sub-section
h3 parseTemplateBindings
pre.prettyprint
code.
parseTemplateBindings(input: string, location: any)
:markdown
.l-sub-section
h3 parseInterpolation
pre.prettyprint
code.
parseInterpolation(input: string, location: any)
:markdown
.l-sub-section
h3 wrapLiteralPrimitive
pre.prettyprint
code.
wrapLiteralPrimitive(input: string, location: any)
:markdown

View File

@ -0,0 +1,79 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/pipes/pipe.ts#L28-L55">angular2/src/change_detection/pipes/pipe.ts (line 28)</a>
:markdown
An interface for extending the list of pipes known to Angular.
If you are writing a custom <a href='Pipe-interface.html'><code>Pipe</code></a>, you must extend this interface.
#Example
```
class DoublePipe implements Pipe {
supports(obj) {
return true;
}
onDestroy() {}
transform(value, args = []) {
return `${value}${value}`;
}
}
```
.l-main-section
h2 Members
.l-sub-section
h3 supports
pre.prettyprint
code.
supports(obj: any)
:markdown
.l-sub-section
h3 onDestroy
pre.prettyprint
code.
onDestroy()
:markdown
.l-sub-section
h3 transform
pre.prettyprint
code.
transform(value: any, args: List&lt;any&gt;)
:markdown

View File

@ -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/2.0.0-alpha.32/modules/angular2/src/change_detection/pipes/pipe.ts#L75-L80">angular2/src/change_detection/pipes/pipe.ts (line 75)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 supports
pre.prettyprint
code.
supports(obs: any)
:markdown
.l-sub-section
h3 create
pre.prettyprint
code.
create(cdRef: ChangeDetectorRef)
:markdown

View File

@ -0,0 +1,69 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/pipes/pipes.ts#L6-L115">angular2/src/change_detection/pipes/pipes.ts (line 6)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(config: StringMap&lt;string, PipeFactory[]&gt;)
:markdown
.l-sub-section
h3 config
:markdown
Map of <a href='Pipe-interface.html'><code>Pipe</code></a> names to <a href='PipeFactory-interface.html'><code>PipeFactory</code></a> lists used to configure the
<a href='Pipes-class.html'><code>Pipes</code></a> registry.
#Example
```
var pipesConfig = {
'json': [jsonPipeFactory]
}
@Component({
viewInjector: [
bind(Pipes).toValue(new Pipes(pipesConfig))
]
})
```
.l-sub-section
h3 get
pre.prettyprint
code.
get(type: string, obj: any, cdRef?: ChangeDetectorRef, existingPipe?: Pipe)
:markdown

View File

@ -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/2.0.0-alpha.32/modules/angular2/src/change_detection/change_detection.ts#L115-L143">angular2/src/change_detection/change_detection.ts (line 115)</a>
:markdown
Implements change detection using a map of pregenerated proto detectors.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(protoChangeDetectorsForTest?:
StringMap&lt;string, Function&gt;)
:markdown
.l-sub-section
h3 createProtoChangeDetector
pre.prettyprint
code.
createProtoChangeDetector(definition: ChangeDetectorDefinition)
:markdown

View File

@ -0,0 +1,26 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/interfaces.ts#L59-L61">angular2/src/change_detection/interfaces.ts (line 59)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 instantiate
pre.prettyprint
code.
instantiate(dispatcher: any)
:markdown

View File

@ -0,0 +1,41 @@
p.location-badge.
exported from <a href='../change_detection'>angular2/change_detection</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/pipes/pipe.ts#L2-L18">angular2/src/change_detection/pipes/pipe.ts (line 2)</a>
:markdown
Indicates that the result of a <a href='Pipe-interface.html'><code>Pipe</code></a> transformation has changed even though the reference
has not changed.
The wrapped value will be unwrapped by change detection, and the unwrapped value will be stored.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(wrapped: any)
:markdown
.l-sub-section
h3 wrapped
:markdown

View File

@ -0,0 +1,174 @@
{
"index" : {
"title" : "Change Detection",
"intro" : "Change detection enables data binding in Angular."
},
"ASTWithSource-class" : {
"title" : "ASTWithSource Class"
},
"AST-class" : {
"title" : "AST Class"
},
"AstTransformer-class" : {
"title" : "AstTransformer Class"
},
"AccessMember-class" : {
"title" : "AccessMember Class"
},
"LiteralArray-class" : {
"title" : "LiteralArray Class"
},
"ImplicitReceiver-class" : {
"title" : "ImplicitReceiver Class"
},
"Lexer-class" : {
"title" : "Lexer Class"
},
"Parser-class" : {
"title" : "Parser Class"
},
"Locals-class" : {
"title" : "Locals Class"
},
"DehydratedException-class" : {
"title" : "DehydratedException Class"
},
"ExpressionChangedAfterItHasBeenChecked-class" : {
"title" : "ExpressionChangedAfterItHasBeenChecked Class"
},
"ChangeDetectionError-class" : {
"title" : "ChangeDetectionError Class"
},
"ProtoChangeDetector-interface" : {
"title" : "ProtoChangeDetector Interface"
},
"ChangeDetector-interface" : {
"title" : "ChangeDetector Interface"
},
"ChangeDispatcher-interface" : {
"title" : "ChangeDispatcher Interface"
},
"ChangeDetection-class" : {
"title" : "ChangeDetection Class"
},
"ChangeDetectorDefinition-class" : {
"title" : "ChangeDetectorDefinition Class"
},
"CHECK_ONCE-var" : {
"title" : "CHECK_ONCE Var"
},
"CHECK_ALWAYS-var" : {
"title" : "CHECK_ALWAYS Var"
},
"DETACHED-var" : {
"title" : "DETACHED Var"
},
"CHECKED-var" : {
"title" : "CHECKED Var"
},
"ON_PUSH-var" : {
"title" : "ON_PUSH Var"
},
"DEFAULT-var" : {
"title" : "DEFAULT Var"
},
"DynamicProtoChangeDetector-class" : {
"title" : "DynamicProtoChangeDetector Class"
},
"BindingRecord-class" : {
"title" : "BindingRecord Class"
},
"DirectiveIndex-class" : {
"title" : "DirectiveIndex Class"
},
"DirectiveRecord-class" : {
"title" : "DirectiveRecord Class"
},
"DynamicChangeDetector-class" : {
"title" : "DynamicChangeDetector Class"
},
"ChangeDetectorRef-class" : {
"title" : "ChangeDetectorRef Class"
},
"Pipes-class" : {
"title" : "Pipes Class"
},
"uninitialized-var" : {
"title" : "uninitialized Var"
},
"WrappedValue-class" : {
"title" : "WrappedValue Class"
},
"Pipe-interface" : {
"title" : "Pipe Interface"
},
"PipeFactory-interface" : {
"title" : "PipeFactory Interface"
},
"BasePipe-class" : {
"title" : "BasePipe Class"
},
"NullPipe-class" : {
"title" : "NullPipe Class"
},
"NullPipeFactory-class" : {
"title" : "NullPipeFactory Class"
},
"defaultPipes-var" : {
"title" : "defaultPipes Var"
},
"DynamicChangeDetection-class" : {
"title" : "DynamicChangeDetection Class"
},
"JitChangeDetection-class" : {
"title" : "JitChangeDetection Class"
},
"PreGeneratedChangeDetection-class" : {
"title" : "PreGeneratedChangeDetection Class"
},
"preGeneratedProtoDetectors-var" : {
"title" : "preGeneratedProtoDetectors Var"
}
}

View File

@ -0,0 +1,11 @@
.l-main-section
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/2.0.0-alpha.32/modules/angular2/src/change_detection/change_detection.ts#L92-L104">angular2/src/change_detection/change_detection.ts (line 92)</a>
:markdown

View File

@ -0,0 +1,11 @@
p.location-badge.
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/change_detection.ts#L1-L56">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
if slug != 'index'
url = "/docs/" + current.path[1] + "/" + current.path[2] + "/" + current.path[3] + "/" + current.path[4] + "/" + slug + ".html"
li.c8
!= partial("../../../../../_includes/_hover-card", {name: page.title, url: url })

View File

@ -0,0 +1,14 @@
.l-main-section
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/2.0.0-alpha.32/modules/angular2/src/change_detection/change_detection.ts#L113-L113">angular2/src/change_detection/change_detection.ts (line 113)</a>
:markdown
Map from <a href='ChangeDetectorDefinition-class.html#id'><code>ChangeDetectorDefinition</code></a> to a factory method which takes a
<a href='Pipes-class.html'><code>Pipes</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.

View File

@ -0,0 +1,11 @@
.l-main-section
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/2.0.0-alpha.32/modules/angular2/src/change_detection/change_detection_util.ts#L8-L8">angular2/src/change_detection/change_detection_util.ts (line 8)</a>
:markdown

View File

@ -0,0 +1,30 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/services/app_root_url.ts#L3-L30">angular2/src/services/app_root_url.ts (line 3)</a>
:markdown
Specifies app root url for the application.
Used by the <a href='Compiler-class.html'><code>Compiler</code></a> when resolving HTML and CSS template URLs.
This interface can be overridden by the application developer to create custom behavior.
See <a href='Compiler-class.html'><code>Compiler</code></a>
.l-main-section
h2 Members
.l-sub-section
h3 value
:markdown
Returns the base URL of the currently running application.

View File

@ -0,0 +1,284 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/view_manager.ts#L17-L359">angular2/src/core/compiler/view_manager.ts (line 17)</a>
:markdown
Entry point for creating, moving views in the view hierarchy and destroying views.
This manager contains all recursion and delegates to helper methods
in AppViewManagerUtils and the Renderer, so unit tests get simpler.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(_viewPool: AppViewPool, _viewListener: AppViewListener, _utils: AppViewManagerUtils, _renderer: Renderer)
:markdown
.l-sub-section
h3 getViewContainer
pre.prettyprint
code.
getViewContainer(location: ElementRef)
:markdown
Returns a <a href='ViewContainerRef-class.html'><code>ViewContainerRef</code></a> at the <a href='ElementRef-class.html'><code>ElementRef</code></a> location.
.l-sub-section
h3 getHostElement
pre.prettyprint
code.
getHostElement(hostViewRef: ViewRef)
:markdown
Return the first child element of the host element view.
.l-sub-section
h3 getNamedElementInComponentView
pre.prettyprint
code.
getNamedElementInComponentView(hostLocation: ElementRef, variableName: string)
:markdown
Returns an ElementRef for the element with the given variable name
in the current view.
- `hostLocation`: <a href='ElementRef-class.html'><code>ElementRef</code></a> of any element in the View which defines the scope of
search.
- `variableName`: Name of the variable to locate.
- Returns <a href='ElementRef-class.html'><code>ElementRef</code></a> of the found element or null. (Throws if not found.)
.l-sub-section
h3 getComponent
pre.prettyprint
code.
getComponent(hostLocation: ElementRef)
:markdown
Returns the component instance for a given element.
The component is the execution context as seen by an expression at that <a href='ElementRef-class.html'><code>ElementRef</code></a>
location.
.l-sub-section
h3 createRootHostView
pre.prettyprint
code.
createRootHostView(hostProtoViewRef: ProtoViewRef, overrideSelector: string, injector: Injector)
:markdown
Load component view into existing element.
Use this if a host element is already in the DOM and it is necessary to upgrade
the element into Angular component by attaching a view but reusing the existing element.
- `hostProtoViewRef`: <a href='ProtoViewRef-class.html'><code>ProtoViewRef</code></a> Proto view to use in creating a view for this
component.
- `overrideSelector`: (optional) selector to use in locating the existing element to load
the view into. If not specified use the selector in the component definition of the
`hostProtoView`.
- injector: <a href='../di/Injector-class.html'><code>Injector</code></a> to use as parent injector for the view.
See <a href='AppViewManager-class.html#destroyRootHostView'><code>AppViewManager</code></a>.
```
@ng.Component({
selector: 'child-component'
})
@ng.View({
template: 'Child'
})
class ChildComponent {
}
@ng.Component({
selector: 'my-app'
})
@ng.View({
template: `
Parent (<some-component></some-component>)
`
})
class MyApp {
viewRef: ng.ViewRef;
constructor(public appViewManager: ng.AppViewManager, compiler: ng.Compiler) {
compiler.compileInHost(ChildComponent).then((protoView: ng.ProtoViewRef) => {
this.viewRef = appViewManager.createRootHostView(protoView, 'some-component', null);
})
}
onDestroy() {
this.appViewManager.destroyRootHostView(this.viewRef);
this.viewRef = null;
}
}
ng.bootstrap(MyApp);
```
.l-sub-section
h3 destroyRootHostView
pre.prettyprint
code.
destroyRootHostView(hostViewRef: ViewRef)
:markdown
Remove the View created with <a href='AppViewManager-class.html#createRootHostView'><code>AppViewManager</code></a>.
.l-sub-section
h3 createEmbeddedViewInContainer
pre.prettyprint
code.
createEmbeddedViewInContainer(viewContainerLocation: ElementRef, atIndex: number, templateRef: TemplateRef)
:markdown
See <a href='AppViewManager-class.html#destroyViewInContainer'><code>AppViewManager</code></a>.
.l-sub-section
h3 createHostViewInContainer
pre.prettyprint
code.
createHostViewInContainer(viewContainerLocation: ElementRef, atIndex: number, protoViewRef: ProtoViewRef, imperativelyCreatedInjector: ResolvedBinding[])
:markdown
See <a href='AppViewManager-class.html#destroyViewInContainer'><code>AppViewManager</code></a>.
.l-sub-section
h3 destroyViewInContainer
pre.prettyprint
code.
destroyViewInContainer(viewContainerLocation: ElementRef, atIndex: number)
:markdown
See <a href='AppViewManager-class.html#createViewInContainer'><code>AppViewManager</code></a>.
.l-sub-section
h3 attachViewInContainer
pre.prettyprint
code.
attachViewInContainer(viewContainerLocation: ElementRef, atIndex: number, viewRef: ViewRef)
:markdown
See <a href='AppViewManager-class.html#detachViewInContainer'><code>AppViewManager</code></a>.
.l-sub-section
h3 detachViewInContainer
pre.prettyprint
code.
detachViewInContainer(viewContainerLocation: ElementRef, atIndex: number)
:markdown
See <a href='AppViewManager-class.html#attachViewInContainer'><code>AppViewManager</code></a>.

View File

@ -0,0 +1,88 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/application_common.ts#L317-L362">angular2/src/core/application_common.ts (line 317)</a>
:markdown
Represents a Angular's representation of an Application.
`ApplicationRef` represents a running application instance. Use it to retrieve the host
component, injector,
or dispose of an application.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(hostComponent: ComponentRef, hostComponentType: Type, injector: Injector)
:markdown
.l-sub-section
h3 hostComponentType
:markdown
Returns the current <a href='../annotations/Component-var.html'><code>Component</code></a> type.
.l-sub-section
h3 hostComponent
:markdown
Returns the current <a href='../annotations/Component-var.html'><code>Component</code></a> instance.
.l-sub-section
h3 dispose
pre.prettyprint
code.
dispose()
:markdown
Dispose (un-load) the application.
.l-sub-section
h3 injector
:markdown
Returns the root application <a href='../di/Injector-class.html'><code>Injector</code></a>.

View File

@ -0,0 +1,58 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/compiler.ts#L60-L355">angular2/src/core/compiler/compiler.ts (line 60)</a>
:markdown
## URL Resolution
```
var appRootUrl: AppRootUrl = ...;
var componentUrlMapper: ComponentUrlMapper = ...;
var urlResolver: UrlResolver = ...;
var componentType: Type = ...;
var componentAnnotation: ComponentAnnotation = ...;
var viewAnnotation: ViewAnnotation = ...;
// Resolving a URL
var url = viewAnnotation.templateUrl;
var componentUrl = componentUrlMapper.getUrl(componentType);
var componentResolvedUrl = urlResolver.resolve(appRootUrl.value, componentUrl);
var templateResolvedUrl = urlResolver.resolve(componetResolvedUrl, url);
```
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(reader: DirectiveResolver, cache: CompilerCache, viewResolver: ViewResolver, componentUrlMapper: ComponentUrlMapper, urlResolver: UrlResolver, render:RenderCompiler, protoViewFactory: ProtoViewFactory, appUrl: AppRootUrl)
:markdown
.l-sub-section
h3 compileInHost
pre.prettyprint
code.
compileInHost(componentTypeOrBinding: Type | Binding)
:markdown

View File

@ -0,0 +1,76 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/dynamic_component_loader.ts#L7-L13">angular2/src/core/compiler/dynamic_component_loader.ts (line 7)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(location: ElementRef, instance: any, dispose: Function)
:markdown
.l-sub-section
h3 location
:markdown
.l-sub-section
h3 instance
:markdown
.l-sub-section
h3 dispose
:markdown
.l-sub-section
h3 hostView
:markdown

View File

@ -0,0 +1,35 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/component_url_mapper.ts#L3-L21">angular2/src/core/compiler/component_url_mapper.ts (line 3)</a>
:markdown
Resolve a `Type` from a <a href='../annotations/Component-var.html'><code>Component</code></a> into a URL.
This interface can be overridden by the application developer to create custom behavior.
See <a href='Compiler-class.html'><code>Compiler</code></a>
.l-main-section
h2 Members
.l-sub-section
h3 getUrl
pre.prettyprint
code.
getUrl(component: Type)
:markdown
Returns the base URL to the component source file.
The returned URL could be:
- an absolute URL,
- a path relative to the application

View File

@ -0,0 +1,32 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/directive_resolver.ts#L4-L30">angular2/src/core/compiler/directive_resolver.ts (line 4)</a>
:markdown
Resolve a `Type` for <a href='../annotations/Directive-var.html'><code>Directive</code></a>.
This interface can be overridden by the application developer to create custom behavior.
See <a href='Compiler-class.html'><code>Compiler</code></a>
.l-main-section
h2 Members
.l-sub-section
h3 resolve
pre.prettyprint
code.
resolve(type: Type)
:markdown
Return <a href='../annotations/Directive-var.html'><code>Directive</code></a> for a given `Type`.

View File

@ -0,0 +1,87 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/dynamic_component_loader.ts#L13-L79">angular2/src/core/compiler/dynamic_component_loader.ts (line 13)</a>
:markdown
Service for dynamically loading a Component into an arbitrary position in the internal Angular
application tree.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(_compiler: Compiler, _viewManager: AppViewManager)
:markdown
.l-sub-section
h3 loadAsRoot
pre.prettyprint
code.
loadAsRoot(typeOrBinding: Type | Binding, overrideSelector: string, injector: Injector)
:markdown
Loads a root component that is placed at the first element that matches the component's
selector.
The loaded component receives injection normally as a hosted view.
.l-sub-section
h3 loadIntoLocation
pre.prettyprint
code.
loadIntoLocation(typeOrBinding: Type | Binding, hostLocation: ElementRef, anchorName: string, bindings?: ResolvedBinding[])
:markdown
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.
.l-sub-section
h3 loadNextToLocation
pre.prettyprint
code.
loadNextToLocation(typeOrBinding: Type | Binding, location: ElementRef, bindings?: ResolvedBinding[])
:markdown
Loads a component next to the provided ElementRef. The loaded component receives
injection normally as a hosted view.

View File

@ -0,0 +1,113 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/element_ref.ts#L3-L63">angular2/src/core/compiler/element_ref.ts (line 3)</a>
:markdown
Reference to the element.
Represents an opaque reference to the underlying element. The element is a DOM ELement in
a Browser, but may represent other types on other rendering platforms. In the browser the
`ElementRef` can be sent to the web-worker. Web Workers can not have references to the
DOM Elements.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(parentView: ViewRef, boundElementIndex: number, renderBoundElementIndex: number, _renderer: Renderer)
:markdown
.l-sub-section
h3 parentView
:markdown
Reference to the <a href='ViewRef-class.html'><code>ViewRef</code></a> where the `ElementRef` is inside of.
.l-sub-section
h3 boundElementIndex
:markdown
Index of the element inside the <a href='ViewRef-class.html'><code>ViewRef</code></a>.
This is used internally by the Angular framework to locate elements.
.l-sub-section
h3 renderBoundElementIndex
:markdown
Index of the element inside the `RenderViewRef`.
This is used internally by the Angular framework to locate elements.
.l-sub-section
h3 renderView
:markdown
.l-sub-section
h3 nativeElement
:markdown
Returns the native Element implementation.
In the browser this represents the DOM Element.
The `nativeElement` can be used as an escape hatch when direct DOM manipulation is needed. Use
this with caution, as it creates tight coupling between your application and the Browser, which
will not work in WebWorkers.
NOTE: This method will return null in the webworker scenario!

View File

@ -0,0 +1,113 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/facade/async.ts#L89-L128">angular2/src/facade/async.ts (line 89)</a>
:markdown
Use Rx.Observable but provides an adapter to make it work as specified here:
https://github.com/jhusain/observable-spec
Once a reference implementation of the spec is available, switch to it.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor()
:markdown
.l-sub-section
h3 observer
pre.prettyprint
code.
observer(generator: any)
:markdown
.l-sub-section
h3 toRx
pre.prettyprint
code.
toRx()
:markdown
.l-sub-section
h3 next
pre.prettyprint
code.
next(value: any)
:markdown
.l-sub-section
h3 throw
pre.prettyprint
code.
throw(error: any)
:markdown
.l-sub-section
h3 return
pre.prettyprint
code.
return(value?: any)
:markdown

View File

@ -0,0 +1,79 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/interface_query.ts#L1-L78">angular2/src/core/compiler/interface_query.ts (line 1)</a>
:markdown
An iterable live list of components in the Light DOM.
Injectable Objects that contains a live list of child directives in the light DOM of a directive.
The directives are kept in depth-first pre-order traversal of the DOM.
The `QueryList` is iterable, therefore it can be used in both javascript code with `for..of` loop
as well as in
template with `*ng-for="of"` directive.
NOTE: In the future this class will implement an `Observable` interface. For now it uses a plain
list of observable
callbacks.
# Example:
Assume that `<tabs>` component would like to get a list its children which are `<pane>`
components as shown in this
example:
```html
<tabs>
<pane title="Overview">...</pane>
<pane *ng-for="#o of objects" [title]="o.title">{{o.text}}</pane>
</tabs>
```
In the above example the list of `<tabs>` elements needs to get a list of `<pane>` elements so
that it could render
tabs with the correct titles and in the correct order.
A possible solution would be for a `<pane>` to inject `<tabs>` component and then register itself
with `<tabs>`
component's on `hydrate` and deregister on `dehydrate` event. While a reasonable approach, this
would only work
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>` 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
component`s light DOM.
```javascript
@Component({
selector: 'tabs'
})
@View({
template: `
<ul>
<li *ng-for="#pane of panes">{{pane.title}}</li>
</ul>
<content></content>
`
})
class Tabs {
panes: QueryList<Pane>
constructor(@Query(Pane) panes:QueryList<Pane>) {
this.panes = panes;
}
}
@Component({
selector: 'pane',
properties: ['title']
})
@View(...)
class Pane {
title:string;
}
```

View File

@ -0,0 +1,176 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/zone/ng_zone.ts#L4-L237">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.
The wrapper maintains an "inner" and an "mount" `Zone`. The application code will executes
in the "inner" zone unless `runOutsideAngular` is explicitely called.
A typical application will create a singleton `NgZone`. The outer `Zone` is a fork of the root
`Zone`. The default `onTurnDone` runs the Angular change detection.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor({enableLongStackTrace}: any)
:markdown
Associates with this
- a "root" zone, which the one that instantiated this.
- an "inner" zone, which is a child of the root zone.
.l-sub-section
h3 overrideOnTurnStart
pre.prettyprint
code.
overrideOnTurnStart(onTurnStartFn: Function)
:markdown
Sets the zone hook that is called just before Angular event turn starts.
It is called once per browser event.
.l-sub-section
h3 overrideOnTurnDone
pre.prettyprint
code.
overrideOnTurnDone(onTurnDoneFn: Function)
:markdown
Sets the zone hook that is called immediately after Angular processes
all pending microtasks.
.l-sub-section
h3 overrideOnEventDone
pre.prettyprint
code.
overrideOnEventDone(onEventDoneFn: Function)
:markdown
Sets the zone hook that is called immediately after the last turn in
an event completes. At this point Angular will no longer attempt to
sync the UI. Any changes to the data model will not be reflected in the
DOM. `onEventDoneFn` is executed outside Angular zone.
This hook is useful for validating application state (e.g. in a test).
.l-sub-section
h3 overrideOnErrorHandler
pre.prettyprint
code.
overrideOnErrorHandler(errorHandlingFn: Function)
:markdown
Sets the zone hook that is called when an error is uncaught in the
Angular zone. The first argument is the error. The second argument is
the stack trace.
.l-sub-section
h3 run
pre.prettyprint
code.
run(fn: () =&gt; any)
:markdown
Runs `fn` in the inner zone and returns whatever it returns.
In a typical app where the inner zone is the Angular zone, this allows one to make use of the
Angular's auto digest mechanism.
```
var zone: NgZone = [ref to the application zone];
zone.run(() => {
// the change detection will run after this function and the microtasks it enqueues have
executed.
});
```
.l-sub-section
h3 runOutsideAngular
pre.prettyprint
code.
runOutsideAngular(fn: () =&gt; any)
:markdown
Runs `fn` in the outer zone and returns whatever it returns.
In a typical app where the inner zone is the Angular zone, this allows one to escape Angular's
auto-digest mechanism.
```
var zone: NgZone = [ref to the application zone];
zone.runOusideAngular(() => {
element.onClick(() => {
// Clicking on the element would not trigger the change detection
});
});
```

View File

@ -0,0 +1,26 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/facade/async.ts#L84-L89">angular2/src/facade/async.ts (line 84)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 observer
pre.prettyprint
code.
observer(generator: any)
:markdown

View File

@ -0,0 +1,57 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/view_ref.ts#L85-L128">angular2/src/core/compiler/view_ref.ts (line 85)</a>
:markdown
A reference to an Angular ProtoView.
A ProtoView is a reference to a template for easy creation of views.
(See <a href='AppViewManager-class.html#createViewInContainer'><code>AppViewManager</code></a> and <a href='AppViewManager-class.html#createRootHostView'><code>AppViewManager</code></a>).
A `ProtoView` is a foctary for creating `View`s.
## Example
Given this template
```
Count: {{items.length}}
<ul>
<li *ng-for="var item of items">{{item}}</li>
</ul>
```
The above example we have two <a href='ProtoViewRef-class.html'><code>ProtoViewRef</code></a>s:
Outter <a href='ProtoViewRef-class.html'><code>ProtoViewRef</code></a>:
```
Count: {{items.length}}
<ul>
<template ng-for var-item [ng-for-of]="items"></template>
</ul>
```
Inner <a href='ProtoViewRef-class.html'><code>ProtoViewRef</code></a>:
```
<li>{{item}}</li>
```
Notice that the original template is broken down into two separate <a href='ProtoViewRef-class.html'><code>ProtoViewRef</code></a>s.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(_protoView:AppProtoView)
:markdown

View File

@ -0,0 +1,155 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/query_list.ts#L2-L44">angular2/src/core/compiler/query_list.ts (line 2)</a>
:markdown
Injectable Objects that contains a live list of child directives in the light Dom of a directive.
The directives are kept in depth-first pre-order traversal of the DOM.
In the future this class will implement an Observable interface.
For now it uses a plain list of observable callbacks.
.l-main-section
h2 Members
.l-sub-section
h3 reset
pre.prettyprint
code.
reset(newList: List&lt;T&gt;)
:markdown
.l-sub-section
h3 add
pre.prettyprint
code.
add(obj: T)
:markdown
.l-sub-section
h3 fireCallbacks
pre.prettyprint
code.
fireCallbacks()
:markdown
.l-sub-section
h3 onChange
pre.prettyprint
code.
onChange(callback: () =&gt; void)
:markdown
.l-sub-section
h3 removeCallback
pre.prettyprint
code.
removeCallback(callback: () =&gt; void)
:markdown
.l-sub-section
h3 length
:markdown
.l-sub-section
h3 first
:markdown
.l-sub-section
h3 last
:markdown
.l-sub-section
h3 map
pre.prettyprint
code.
map(fn: (T) =&gt; U)
:markdown

View File

@ -0,0 +1,42 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/render/api.ts#L350-L368">angular2/src/render/api.ts (line 350)</a>
:markdown
Abstract reference to the element which can be marshaled across web-worker boundry.
This interface is used by the Renderer API.
.l-main-section
h2 Members
.l-sub-section
h3 renderView
:markdown
Reference to the `RenderViewRef` where the `RenderElementRef` is inside of.
.l-sub-section
h3 renderBoundElementIndex
:markdown
Index of the element inside the `RenderViewRef`.
This is used internally by the Angular framework to locate elements.

View File

@ -0,0 +1,73 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/template_ref.ts#L3-L32">angular2/src/core/compiler/template_ref.ts (line 3)</a>
:markdown
Reference to a template within a component.
Represents an opaque reference to the underlying template that can
be instantiated using the <a href='ViewContainerRef-class.html'><code>ViewContainerRef</code></a>.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(elementRef: ElementRef)
:markdown
.l-sub-section
h3 elementRef
:markdown
The location of the template
.l-sub-section
h3 protoViewRef
:markdown
.l-sub-section
h3 hasLocal
pre.prettyprint
code.
hasLocal(name: string)
:markdown
Whether this template has a local variable with the given name

View File

@ -0,0 +1,36 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/services/url_resolver.ts#L9-L33">angular2/src/services/url_resolver.ts (line 9)</a>
:markdown
Used by the <a href='Compiler-class.html'><code>Compiler</code></a> when resolving HTML and CSS template URLs.
This interface can be overridden by the application developer to create custom behavior.
See <a href='Compiler-class.html'><code>Compiler</code></a>
.l-main-section
h2 Members
.l-sub-section
h3 resolve
pre.prettyprint
code.
resolve(baseUrl: string, url: string)
:markdown
Resolves the `url` given the `baseUrl`:
- when the `url` is null, the `baseUrl` is returned,
- if `url` is relative ('path/to/here', './path/to/here'), the resolved url is a combination of
`baseUrl` and `url`,
- if `url` is absolute (it has a scheme: 'http://', 'https://' or start with '/'), the `url` is
returned as is (ignoring the `baseUrl`)

View File

@ -0,0 +1,201 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/view_container_ref.ts#L10-L67">angular2/src/core/compiler/view_container_ref.ts (line 10)</a>
:markdown
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(viewManager:AppViewManager, element: ElementRef)
:markdown
.l-sub-section
h3 viewManager
:markdown
.l-sub-section
h3 element
:markdown
.l-sub-section
h3 clear
pre.prettyprint
code.
clear()
:markdown
.l-sub-section
h3 get
pre.prettyprint
code.
get(index: number)
:markdown
.l-sub-section
h3 length
:markdown
.l-sub-section
h3 createEmbeddedView
pre.prettyprint
code.
createEmbeddedView(templateRef: TemplateRef, atIndex?: number)
:markdown
.l-sub-section
h3 createHostView
pre.prettyprint
code.
createHostView(protoViewRef?: ProtoViewRef, atIndex?: number, dynamicallyCreatedBindings?: ResolvedBinding[])
:markdown
.l-sub-section
h3 insert
pre.prettyprint
code.
insert(viewRef: ViewRef, atIndex?: number)
:markdown
.l-sub-section
h3 indexOf
pre.prettyprint
code.
indexOf(viewRef: ViewRef)
:markdown
.l-sub-section
h3 remove
pre.prettyprint
code.
remove(atIndex?: number)
:markdown
.l-sub-section
h3 detach
pre.prettyprint
code.
detach(atIndex?: number)
:markdown
The method can be used together with insert to implement a view move, i.e.
moving the dom nodes while the directives in the view stay intact.

View File

@ -0,0 +1,119 @@
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/compiler/view_ref.ts#L13-L85">angular2/src/core/compiler/view_ref.ts (line 13)</a>
:markdown
A reference to an Angular View.
A View is a fundamental building block of Application UI. A View is the smallest set of
elements which are created and destroyed together. A View can change properties on the elements
within the view, but it can not change the structure of those elements.
To change structure of the elements, the Views can contain zero or more <a href='ViewContainerRef-class.html'><code>ViewContainerRef</code></a>s
which allow the views to be nested.
## Example
Given this template
```
Count: {{items.length}}
<ul>
<li *ng-for="var item of items">{{item}}</li>
</ul>
```
The above example we have two <a href='ProtoViewRef-class.html'><code>ProtoViewRef</code></a>s:
Outter <a href='ProtoViewRef-class.html'><code>ProtoViewRef</code></a>:
```
Count: {{items.length}}
<ul>
<template ng-for var-item [ng-for-of]="items"></template>
</ul>
```
Inner <a href='ProtoViewRef-class.html'><code>ProtoViewRef</code></a>:
```
<li>{{item}}</li>
```
Notice that the original template is broken down into two separate <a href='ProtoViewRef-class.html'><code>ProtoViewRef</code></a>s.
The outter/inner <a href='ProtoViewRef-class.html'><code>ProtoViewRef</code></a>s are then assembled into views like so:
```
<!-- ViewRef: outter-0 -->
Count: 2
<ul>
<template view-container-ref></template>
<!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->
<!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->
</ul>
<!-- /ViewRef: outter-0 -->
```
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(_view:AppView)
:markdown
.l-sub-section
h3 render
:markdown
Return `RenderViewRef`
.l-sub-section
h3 renderFragment
:markdown
Return `RenderFragmentRef`
.l-sub-section
h3 setLocal
pre.prettyprint
code.
setLocal(contextName: string, value: any)
:markdown
Set local variable for a view.

View File

@ -0,0 +1,90 @@
{
"index" : {
"title" : "Core",
"intro" : "Define angular core API here."
},
"appComponentTypeToken-var" : {
"title" : "appComponentTypeToken Var"
},
"ApplicationRef-class" : {
"title" : "ApplicationRef Class"
},
"AppRootUrl-class" : {
"title" : "AppRootUrl Class"
},
"UrlResolver-class" : {
"title" : "UrlResolver Class"
},
"ComponentUrlMapper-class" : {
"title" : "ComponentUrlMapper Class"
},
"DirectiveResolver-class" : {
"title" : "DirectiveResolver Class"
},
"Compiler-class" : {
"title" : "Compiler Class"
},
"AppViewManager-class" : {
"title" : "AppViewManager Class"
},
"IQueryList-interface" : {
"title" : "IQueryList Interface"
},
"QueryList-class" : {
"title" : "QueryList Class"
},
"ElementRef-class" : {
"title" : "ElementRef Class"
},
"TemplateRef-class" : {
"title" : "TemplateRef Class"
},
"RenderElementRef-interface" : {
"title" : "RenderElementRef Interface"
},
"ViewRef-class" : {
"title" : "ViewRef Class"
},
"ProtoViewRef-class" : {
"title" : "ProtoViewRef Class"
},
"ViewContainerRef-class" : {
"title" : "ViewContainerRef Class"
},
"DynamicComponentLoader-class" : {
"title" : "DynamicComponentLoader Class"
},
"ComponentRef-class" : {
"title" : "ComponentRef Class"
},
"NgZone-class" : {
"title" : "NgZone Class"
},
"Observable-class" : {
"title" : "Observable Class"
},
"EventEmitter-class" : {
"title" : "EventEmitter Class"
}
}

View File

@ -0,0 +1,25 @@
.l-main-section
h2 appComponentTypeToken <span class="type">variable</span>
p.location-badge.
exported from <a href='../core'>angular2/core</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/core/application_tokens.ts#L25-L25">angular2/src/core/application_tokens.ts (line 25)</a>
:markdown
An opaque token representing the application root type in the <a href='../di/Injector-class.html'><code>Injector</code></a>.
```
@Component(...)
@View(...)
class MyApp {
...
}
bootstrap(MyApp).then((appRef:ApplicationRef) {
expect(appRef.injector.get(appComponentTypeToken)).toEqual(MyApp);
});
```

View File

@ -0,0 +1,11 @@
p.location-badge.
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/core.ts#L1-L33">angular2/core.ts (line 1)</a>
ul
for page, slug in public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]]._data
if slug != 'index'
url = "/docs/" + current.path[1] + "/" + current.path[2] + "/" + current.path[3] + "/" + current.path[4] + "/" + slug + ".html"
li.c8
!= partial("../../../../../_includes/_hover-card", {name: page.title, url: url })

View File

@ -0,0 +1,137 @@
p.location-badge.
exported from <a href='../di'>angular2/di</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/di/exceptions.ts#L27-L58">angular2/src/di/exceptions.ts (line 27)</a>
:markdown
Base class for all errors arising from misconfigured bindings.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(injector: Injector, key: Key, constructResolvingMessage: Function, originalException?: any, originalStack?: any)
:markdown
.l-sub-section
h3 name
:markdown
.l-sub-section
h3 message
:markdown
.l-sub-section
h3 keys
:markdown
.l-sub-section
h3 injectors
:markdown
.l-sub-section
h3 constructResolvingMessage
:markdown
.l-sub-section
h3 addKey
pre.prettyprint
code.
addKey(injector: Injector, key: Key)
:markdown
.l-sub-section
h3 context
:markdown
.l-sub-section
h3 toString
pre.prettyprint
code.
toString()
:markdown

View File

@ -0,0 +1,12 @@
.l-main-section
h2 Ancestor <span class="type">variable</span>
p.location-badge.
exported from <a href='../di'>angular2/di</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/di/decorators.ts#L83-L83">angular2/src/di/decorators.ts (line 83)</a>
:markdown
Factory for creating <a href='AncestorMetadata-class.html'><code>AncestorMetadata</code></a>.

Some files were not shown because too many files have changed in this diff Show More