docs(alpha-37): update to alphabetize left-nav and fix earlier doc omissions
This commit is contained in:
parent
31b68b2aec
commit
7934b8450a
|
@ -1,14 +1,16 @@
|
|||
|
||||
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.37/modules/angular2/src/core/di/exceptions.ts#L28-L56">angular2/src/core/di/exceptions.ts (line 28)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/exceptions.ts#L28-L55">angular2/src/core/di/exceptions.ts (line 28)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Base class for all errors arising from misconfigured bindings.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,74 +18,52 @@ p.location-badge.
|
|||
constructor(injector: Injector, key: Key, constructResolvingMessage: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 name
|
||||
h3#message message
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 message
|
||||
h3#keys keys
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 keys
|
||||
h3#injectors injectors
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 injectors
|
||||
h3#constructResolvingMessage constructResolvingMessage
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 constructResolvingMessage
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 addKey
|
||||
h3#addKey addKey
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -91,20 +71,16 @@ p.location-badge.
|
|||
addKey(injector: Injector, key: Key)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 context
|
||||
h3#context context
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
|
||||
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.37/modules/angular2/src/core/forms/model.ts#L37-L135">angular2/src/core/forms/model.ts (line 37)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/model.ts#L38-L132">angular2/src/core/forms/model.ts (line 38)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Omitting from external API doc as this is really an abstract internal concept.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,134 +18,112 @@ p.location-badge.
|
|||
constructor(validator: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 validator
|
||||
h3#validator validator
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 value
|
||||
h3#value value
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 status
|
||||
h3#status status
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 valid
|
||||
h3#valid valid
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 errors
|
||||
h3#errors errors
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 pristine
|
||||
h3#pristine pristine
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 dirty
|
||||
h3#dirty dirty
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 touched
|
||||
h3#touched touched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 untouched
|
||||
h3#untouched untouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 valueChanges
|
||||
h3#valueChanges valueChanges
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 markAsTouched
|
||||
h3#markAsTouched markAsTouched
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -151,15 +131,13 @@ p.location-badge.
|
|||
markAsTouched()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 markAsDirty
|
||||
h3#markAsDirty markAsDirty
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -167,15 +145,13 @@ p.location-badge.
|
|||
markAsDirty({onlySelf}?: {onlySelf?: boolean})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 setParent
|
||||
h3#setParent setParent
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -183,15 +159,13 @@ p.location-badge.
|
|||
setParent(parent: ControlGroup | ControlArray)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 updateValidity
|
||||
h3#updateValidity updateValidity
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -199,15 +173,13 @@ p.location-badge.
|
|||
updateValidity({onlySelf}?: {onlySelf?: boolean})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 updateValueAndValidity
|
||||
h3#updateValueAndValidity updateValueAndValidity
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -215,15 +187,13 @@ p.location-badge.
|
|||
updateValueAndValidity({onlySelf, emitEvent}?: {onlySelf?: boolean, emitEvent?: boolean})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 find
|
||||
h3#find find
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -231,15 +201,13 @@ p.location-badge.
|
|||
find(path: Array<string | number>| string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 getError
|
||||
h3#getError getError
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -247,15 +215,13 @@ p.location-badge.
|
|||
getError(errorCode: string, path?: string[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hasError
|
||||
h3#hasError hasError
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -263,8 +229,6 @@ p.location-badge.
|
|||
hasError(errorCode: string, path?: string[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,100 +4,83 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/abstract_control_directive.ts#L1-L19">angular2/src/core/forms/directives/abstract_control_directive.ts (line 1)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 control
|
||||
h3#control control
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 value
|
||||
h3#value value
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 valid
|
||||
h3#valid valid
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 errors
|
||||
h3#errors errors
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 pristine
|
||||
h3#pristine pristine
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 dirty
|
||||
h3#dirty dirty
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 touched
|
||||
h3#touched touched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 untouched
|
||||
h3#untouched untouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
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.37/modules/angular2/src/core/compiler/interfaces.ts#L124-L142">angular2/src/core/compiler/interfaces.ts (line 124)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 afterContentChecked
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterContentChecked()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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.37/modules/angular2/src/core/compiler/interfaces.ts#L125-L141">angular2/src/core/compiler/interfaces.ts (line 125)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when the bindings of all its content children have been checked (whether
|
||||
they have changed or not).
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component(...)
|
||||
class MyComponent implements AfterContentChecked {
|
||||
afterContentChecked(): void {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#afterContentChecked afterContentChecked
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterContentChecked()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
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.37/modules/angular2/src/core/compiler/interfaces.ts#L106-L124">angular2/src/core/compiler/interfaces.ts (line 106)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 afterContentInit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterContentInit()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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.37/modules/angular2/src/core/compiler/interfaces.ts#L109-L125">angular2/src/core/compiler/interfaces.ts (line 109)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when the bindings of all its content children have been checked the first
|
||||
time (whether they have changed or not).
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component(...)
|
||||
class MyComponent implements AfterContentInit {
|
||||
afterContentInit(): void {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#afterContentInit afterContentInit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterContentInit()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
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.37/modules/angular2/src/core/compiler/interfaces.ts#L160-L178">angular2/src/core/compiler/interfaces.ts (line 160)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 afterViewChecked
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterViewChecked()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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.37/modules/angular2/src/core/compiler/interfaces.ts#L157-L173">angular2/src/core/compiler/interfaces.ts (line 157)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when the bindings of all its view children have been checked (whether they
|
||||
have changed or not).
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component(...)
|
||||
class MyComponent implements AfterViewChecked {
|
||||
afterViewChecked(): void {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#afterViewChecked afterViewChecked
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterViewChecked()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
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.37/modules/angular2/src/core/compiler/interfaces.ts#L142-L160">angular2/src/core/compiler/interfaces.ts (line 142)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 afterViewInit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterViewInit()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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.37/modules/angular2/src/core/compiler/interfaces.ts#L141-L157">angular2/src/core/compiler/interfaces.ts (line 141)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when the bindings of all its view children have been checked the first time
|
||||
(whether they have changed or not).
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component(...)
|
||||
class MyComponent implements AfterViewInit {
|
||||
afterViewInit(): void {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#afterViewInit afterViewInit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterViewInit()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -4,7 +4,15 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/services/app_root_url.ts#L2-L25">angular2/src/core/services/app_root_url.ts (line 2)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Specifies app root url for the application.
|
||||
|
||||
Used by the <a href='Compiler-interface.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-interface.html'><code>Compiler</code></a>
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -18,7 +26,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -26,14 +34,12 @@ p.location-badge.
|
|||
constructor(value: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 value
|
||||
h3#value value
|
||||
|
||||
|
||||
:markdown
|
||||
|
|
|
@ -4,7 +4,11 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/view_manager.ts#L19-L379">angular2/src/core/compiler/view_manager.ts (line 19)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
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 Annotations
|
||||
|
@ -18,7 +22,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 getViewContainer
|
||||
h3#getViewContainer getViewContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -35,7 +39,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 getHostElement
|
||||
h3#getHostElement getHostElement
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -52,7 +56,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 getNamedElementInComponentView
|
||||
h3#getNamedElementInComponentView getNamedElementInComponentView
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -75,7 +79,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 getComponent
|
||||
h3#getComponent getComponent
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -95,7 +99,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 createRootHostView
|
||||
h3#createRootHostView createRootHostView
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -163,7 +167,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 destroyRootHostView
|
||||
h3#destroyRootHostView destroyRootHostView
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -180,7 +184,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 createEmbeddedViewInContainer
|
||||
h3#createEmbeddedViewInContainer createEmbeddedViewInContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -197,7 +201,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 createHostViewInContainer
|
||||
h3#createHostViewInContainer createHostViewInContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -214,7 +218,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 destroyViewInContainer
|
||||
h3#destroyViewInContainer destroyViewInContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -231,7 +235,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 attachViewInContainer
|
||||
h3#attachViewInContainer attachViewInContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -248,7 +252,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 detachViewInContainer
|
||||
h3#detachViewInContainer detachViewInContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
|
|
@ -1,18 +1,28 @@
|
|||
|
||||
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.37/modules/angular2/src/core/application_ref.ts#L3-L47">angular2/src/core/application_ref.ts (line 3)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/application_ref.ts#L242-L320">angular2/src/core/application_ref.ts (line 242)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Represents an Angular application.
|
||||
|
||||
Use to retrieve the application <a href='Injector-class.html'><code>Injector</code></a> or to bootstrap new
|
||||
components at the root of the application. Can also be used to dispose
|
||||
of the entire application and all its loaded components.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 hostComponentType
|
||||
h3#registerBootstrapListener registerBootstrapListener
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
registerBootstrapListener(listener: (ref: ComponentRef) => void)
|
||||
|
||||
:markdown
|
||||
Returns the current <a href='ComponentMetadata-class.html'><code>ComponentMetadata</code></a> type.
|
||||
Register a listener to be called each time a new root component type is bootstrapped.
|
||||
|
||||
|
||||
|
||||
|
@ -21,11 +31,16 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostComponent
|
||||
h3#bootstrap bootstrap
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
bootstrap(componentType: Type, bindings?: Array<Type | Binding | any[]>)
|
||||
|
||||
:markdown
|
||||
Returns the current <a href='ComponentMetadata-class.html'><code>ComponentMetadata</code></a> instance.
|
||||
Bootstrap a new component at the root level of the application, optionally with
|
||||
component specific bindings.
|
||||
|
||||
|
||||
|
||||
|
@ -34,7 +49,33 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 dispose
|
||||
h3#injector injector
|
||||
|
||||
|
||||
:markdown
|
||||
Retrieve the application <a href='Injector-class.html'><code>Injector</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#zone zone
|
||||
|
||||
|
||||
:markdown
|
||||
Retrieve the application <a href='NgZone-interface.html'><code>NgZone</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#dispose dispose
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -42,22 +83,6 @@ p.location-badge.
|
|||
dispose()
|
||||
|
||||
:markdown
|
||||
Dispose (un-load) the application.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 injector
|
||||
|
||||
|
||||
:markdown
|
||||
Returns the root application <a href='Injector-class.html'><code>Injector</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,31 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/async_pipe.ts#L35-L133">angular2/src/core/pipes/async_pipe.ts (line 35)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
The `async` pipe subscribes to an Observable or Promise and returns the latest value it has
|
||||
emitted.
|
||||
When a new value is emitted, the `async` pipe marks the component to be checked for changes.
|
||||
|
||||
# Example
|
||||
The example below binds the `time` Observable to the view. Every 500ms, the `time` Observable
|
||||
updates the view with the current time.
|
||||
|
||||
```
|
||||
import {Observable} from 'angular2/core';
|
||||
@Component({
|
||||
selector: "task-cmp"
|
||||
})
|
||||
@View({
|
||||
template: "Time: {{ time | async }}"
|
||||
})
|
||||
class Task {
|
||||
time = new Observable<number>(observer => {
|
||||
setInterval(_ =>
|
||||
observer.next(new Date().getTime()), 500);
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -25,7 +49,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -33,14 +57,12 @@ p.location-badge.
|
|||
constructor(_ref: ChangeDetectorRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 onDestroy
|
||||
h3#onDestroy onDestroy
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -48,15 +70,13 @@ p.location-badge.
|
|||
onDestroy()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 transform
|
||||
h3#transform transform
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -64,8 +84,6 @@ p.location-badge.
|
|||
transform(obj: Observable | Promise<any>, args?: any[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
.l-main-section
|
||||
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.37/modules/angular2/src/core/metadata.ts#L503-L503">angular2/src/core/metadata.ts (line 503)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L507-L507">angular2/src/core/metadata.ts (line 507)</a>
|
||||
|
||||
:markdown
|
||||
<a href='AttributeMetadata-class.html'><code>AttributeMetadata</code></a> factory function.
|
||||
|
|
|
@ -1,7 +1,52 @@
|
|||
|
||||
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.37/modules/angular2/src/core/metadata.ts#L278-L329">angular2/src/core/metadata.ts (line 278)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L282-L333">angular2/src/core/metadata.ts (line 282)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
<a href='AttributeMetadata-class.html'><code>AttributeMetadata</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')]
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -4,14 +4,39 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata/di.ts#L9-L50">angular2/src/core/metadata/di.ts (line 9)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
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 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -19,38 +44,32 @@ p.location-badge.
|
|||
constructor(attributeName: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 attributeName
|
||||
h3#attributeName attributeName
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 token
|
||||
h3#token token
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 toString
|
||||
h3#toString toString
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -58,8 +77,6 @@ p.location-badge.
|
|||
toString()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,14 +4,28 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/binding.ts#L41-L229">angular2/src/core/di/binding.ts (line 41)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Describes how_ the <a href='Injector-class.html'><code>Injector</code></a> should instantiate a given token.
|
||||
|
||||
See <a href='bind-function.html'><code>bind</code></a>.
|
||||
|
||||
## Example
|
||||
|
||||
```javascript
|
||||
var injector = Injector.resolveAndCreate([
|
||||
new Binding(String, { toValue: 'Hello' })
|
||||
]);
|
||||
|
||||
expect(injector.get(String)).toEqual('Hello');
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -26,14 +40,12 @@ p.location-badge.
|
|||
})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 token
|
||||
h3#token token
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -46,7 +58,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 toClass
|
||||
h3#toClass toClass
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -87,7 +99,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 toValue
|
||||
h3#toValue toValue
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -110,7 +122,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 toAlias
|
||||
h3#toAlias toAlias
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -153,7 +165,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 toFactory
|
||||
h3#toFactory toFactory
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -179,7 +191,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 dependencies
|
||||
h3#dependencies dependencies
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -206,7 +218,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 multi
|
||||
h3#multi multi
|
||||
|
||||
|
||||
:markdown
|
||||
|
|
|
@ -4,11 +4,13 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/binding.ts#L305-L419">angular2/src/core/di/binding.ts (line 305)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Helper class for the <a href='bind-function.html'><code>bind</code></a> function.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,26 +18,22 @@ p.location-badge.
|
|||
constructor(token: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 token
|
||||
h3#token token
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 toClass
|
||||
h3#toClass toClass
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -79,7 +77,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 toValue
|
||||
h3#toValue toValue
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -106,7 +104,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 toAlias
|
||||
h3#toAlias toAlias
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -154,7 +152,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 toFactory
|
||||
h3#toFactory toFactory
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
|
|
@ -4,11 +4,10 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/injector.ts#L381-L387">angular2/src/core/di/injector.ts (line 381)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,38 +15,32 @@ p.location-badge.
|
|||
constructor(binding: ResolvedBinding, visibility: Visibility)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 binding
|
||||
h3#binding binding
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 visibility
|
||||
h3#visibility visibility
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 getKeyId
|
||||
h3#getKeyId getKeyId
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -55,8 +48,6 @@ p.location-badge.
|
|||
getKeyId()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,4 +4,3 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/debug/debug_element.ts#L184-L199">angular2/src/core/debug/debug_element.ts (line 184)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
.l-main-section
|
||||
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.37/modules/angular2/src/core/directives.ts#L63-L64">angular2/src/core/directives.ts (line 63)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/directives.ts#L64-L65">angular2/src/core/directives.ts (line 64)</a>
|
||||
|
||||
:markdown
|
||||
A collection of the Angular core directives that are likely to be used in each and every Angular
|
||||
|
|
|
@ -4,11 +4,15 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/exceptions.ts#L17-L34">angular2/src/core/change_detection/exceptions.ts (line 17)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Thrown when an expression evaluation raises an exception.
|
||||
|
||||
This error wraps the original exception, this is done to attach expression location information.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,14 +20,12 @@ p.location-badge.
|
|||
constructor(exp: string, originalException: any, originalStack: any, context: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 location
|
||||
h3#location location
|
||||
|
||||
|
||||
:markdown
|
||||
|
|
|
@ -4,11 +4,10 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/constants.ts#L8-L49">angular2/src/core/change_detection/constants.ts (line 8)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 CheckOnce
|
||||
h3#CheckOnce CheckOnce
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -22,7 +21,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 Checked
|
||||
h3#Checked Checked
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -36,7 +35,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 CheckAlways
|
||||
h3#CheckAlways CheckAlways
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -50,7 +49,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 Detached
|
||||
h3#Detached Detached
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -64,7 +63,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 OnPush
|
||||
h3#OnPush OnPush
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -77,7 +76,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 Default
|
||||
h3#Default Default
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -90,7 +89,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 OnPushObserve
|
||||
h3#OnPushObserve OnPushObserve
|
||||
|
||||
|
||||
:markdown
|
||||
|
|
|
@ -4,47 +4,40 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/interfaces.ts#L55-L74">angular2/src/core/change_detection/interfaces.ts (line 55)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 parent
|
||||
h3#parent parent
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 mode
|
||||
h3#mode mode
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ref
|
||||
h3#ref ref
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 addChild
|
||||
h3#addChild addChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -52,15 +45,13 @@ p.location-badge.
|
|||
addChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 addShadowDomChild
|
||||
h3#addShadowDomChild addShadowDomChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -68,15 +59,13 @@ p.location-badge.
|
|||
addShadowDomChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 removeChild
|
||||
h3#removeChild removeChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -84,15 +73,13 @@ p.location-badge.
|
|||
removeChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 removeShadowDomChild
|
||||
h3#removeShadowDomChild removeShadowDomChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -100,15 +87,13 @@ p.location-badge.
|
|||
removeShadowDomChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 remove
|
||||
h3#remove remove
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -116,15 +101,13 @@ p.location-badge.
|
|||
remove()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hydrate
|
||||
h3#hydrate hydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -132,15 +115,13 @@ p.location-badge.
|
|||
hydrate(context: any, locals: Locals, directives: any, pipes: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 dehydrate
|
||||
h3#dehydrate dehydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -148,15 +129,13 @@ p.location-badge.
|
|||
dehydrate()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 markPathToRootAsCheckOnce
|
||||
h3#markPathToRootAsCheckOnce markPathToRootAsCheckOnce
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -164,15 +143,13 @@ p.location-badge.
|
|||
markPathToRootAsCheckOnce()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 handleEvent
|
||||
h3#handleEvent handleEvent
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -180,15 +157,13 @@ p.location-badge.
|
|||
handleEvent(eventName: string, elIndex: number, locals: Locals)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 detectChanges
|
||||
h3#detectChanges detectChanges
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -196,15 +171,13 @@ p.location-badge.
|
|||
detectChanges()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 checkNoChanges
|
||||
h3#checkNoChanges checkNoChanges
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -212,8 +185,6 @@ p.location-badge.
|
|||
checkNoChanges()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
|
||||
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.37/modules/angular2/src/core/change_detection/change_detector_ref.ts#L2-L38">angular2/src/core/change_detection/change_detector_ref.ts (line 2)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/change_detector_ref.ts#L2-L40">angular2/src/core/change_detection/change_detector_ref.ts (line 2)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Controls change detection.
|
||||
|
||||
<a href='ChangeDetectorRef-interface.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 markForCheck
|
||||
h3#markForCheck markForCheck
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -25,7 +30,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 detach
|
||||
h3#detach detach
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -44,7 +49,21 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 reattach
|
||||
h3#detectChanges detectChanges
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
detectChanges()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#reattach reattach
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
|
|
@ -4,7 +4,14 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/checkbox_value_accessor.ts#L9-L66">angular2/src/core/forms/directives/checkbox_value_accessor.ts (line 9)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
The accessor for writing a value and listening to changes on a checkbox input element.
|
||||
|
||||
# Example
|
||||
```
|
||||
<input type="checkbox" [ng-control]="rememberLogin">
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -31,7 +38,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -39,38 +46,32 @@ p.location-badge.
|
|||
constructor(cd: NgControl, _renderer: Renderer, _elementRef: ElementRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 onChange
|
||||
h3#onChange onChange
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 onTouched
|
||||
h3#onTouched onTouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 writeValue
|
||||
h3#writeValue writeValue
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -78,87 +79,73 @@ p.location-badge.
|
|||
writeValue(value: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassUntouched
|
||||
h3#ngClassUntouched ngClassUntouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassTouched
|
||||
h3#ngClassTouched ngClassTouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassPristine
|
||||
h3#ngClassPristine ngClassPristine
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassDirty
|
||||
h3#ngClassDirty ngClassDirty
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassValid
|
||||
h3#ngClassValid ngClassValid
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassInvalid
|
||||
h3#ngClassInvalid ngClassInvalid
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registerOnChange
|
||||
h3#registerOnChange registerOnChange
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -166,15 +153,13 @@ p.location-badge.
|
|||
registerOnChange(fn: (_: any) => {})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registerOnTouched
|
||||
h3#registerOnTouched registerOnTouched
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -182,8 +167,6 @@ p.location-badge.
|
|||
registerOnTouched(fn: () => {})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,13 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/util/decorators.ts#L1-L22">angular2/src/core/util/decorators.ts (line 1)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
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?
|
||||
h3#extends extends?
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -21,7 +23,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
:markdown
|
||||
|
|
|
@ -4,7 +4,26 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/compiler.ts#L71-L361">angular2/src/core/compiler/compiler.ts (line 71)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
## 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 Annotations
|
||||
|
@ -18,7 +37,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 compileInHost
|
||||
h3#compileInHost compileInHost
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -26,8 +45,6 @@ p.location-badge.
|
|||
compileInHost(componentTypeOrBinding: Type | Binding)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
.l-main-section
|
||||
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.37/modules/angular2/src/core/metadata.ts#L487-L488">angular2/src/core/metadata.ts (line 487)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L491-L492">angular2/src/core/metadata.ts (line 491)</a>
|
||||
|
||||
:markdown
|
||||
<a href='ComponentMetadata-class.html'><code>ComponentMetadata</code></a> factory function.
|
||||
|
|
|
@ -4,11 +4,15 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L57-L77">angular2/src/core/metadata.ts (line 57)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Interface for the <a href='ComponentMetadata-class.html'><code>ComponentMetadata</code></a> decorator function.
|
||||
|
||||
See <a href='ComponentFactory-interface.html'><code>ComponentFactory</code></a>.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 View
|
||||
h3#View View
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
|
|
@ -1,7 +1,49 @@
|
|||
|
||||
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.37/modules/angular2/src/core/metadata.ts#L148-L216">angular2/src/core/metadata.ts (line 148)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L148-L220">angular2/src/core/metadata.ts (line 148)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
<a href='ComponentMetadata-class.html'><code>ComponentMetadata</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({...})
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -1,43 +1,127 @@
|
|||
|
||||
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.37/modules/angular2/src/core/metadata/directives.ts#L722-L845">angular2/src/core/metadata/directives.ts (line 722)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata/directives.ts#L745-L903">angular2/src/core/metadata/directives.ts (line 745)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
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 `bindings` and `viewBindings`.
|
||||
|
||||
All template expressions and statements are then evaluated against the component instance.
|
||||
|
||||
For details on the `@View` annotation, see <a href='ViewMetadata-class.html'><code>ViewMetadata</code></a>.
|
||||
|
||||
## Lifecycle hooks
|
||||
|
||||
When the component class implements some <a href='../lifecycle_hooks'><code>undefined</code></a> the callbacks are
|
||||
called by the change detection at defined points in time during the life of the component.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component({
|
||||
selector: 'greet'
|
||||
})
|
||||
@View({
|
||||
template: 'Hello {{name}}!'
|
||||
})
|
||||
class Greet {
|
||||
name: string;
|
||||
|
||||
constructor() {
|
||||
this.name = 'World';
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor({selector, properties, events, host, exportAs, bindings, viewBindings,
|
||||
changeDetection = ChangeDetectionStrategy.Default, compileChildren = true}?: {
|
||||
constructor({selector, properties, events, host, dynamicLoadable, compiledHostTemplate, exportAs,
|
||||
moduleId, bindings, viewBindings, changeDetection = ChangeDetectionStrategy.Default,
|
||||
compileChildren = true}?: {
|
||||
selector?: string,
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
dynamicLoadable?: boolean,
|
||||
compiledHostTemplate?: any,
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
compileChildren?: boolean,
|
||||
viewBindings?: any[],
|
||||
changeDetection?: ChangeDetectionStrategy,
|
||||
})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 changeDetection
|
||||
h3#dynamicLoadable dynamicLoadable
|
||||
|
||||
|
||||
:markdown
|
||||
Declare that this component can be programatically loaded.
|
||||
Every component that is used in bootstrap, routing, ... has to be
|
||||
annotated with this.
|
||||
|
||||
|
||||
|
||||
```
|
||||
@Component({
|
||||
selector: 'root',
|
||||
dynamicLoadable: true
|
||||
})
|
||||
@View({
|
||||
template: 'hello world!'
|
||||
})
|
||||
class RootComponent {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#compiledHostTemplate compiledHostTemplate
|
||||
|
||||
|
||||
:markdown
|
||||
Used by build tools to store the compiled template.
|
||||
Not intended to be used by a user.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#changeDetection changeDetection
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -56,11 +140,11 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 viewBindings
|
||||
h3#viewBindings viewBindings
|
||||
|
||||
|
||||
:markdown
|
||||
Defines the set of injectable objects that are visible to its view dom children.
|
||||
Defines the set of injectable objects that are visible to its view DOM children.
|
||||
|
||||
## Simple Example
|
||||
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
|
||||
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.37/modules/angular2/src/core/compiler/dynamic_component_loader.ts#L7-L42">angular2/src/core/compiler/dynamic_component_loader.ts (line 7)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/dynamic_component_loader.ts#L11-L58">angular2/src/core/compiler/dynamic_component_loader.ts (line 11)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Angular's reference to a component instance.
|
||||
|
||||
`ComponentRef` represents a component instance lifecycle and meta information.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 location
|
||||
h3#location location
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -21,7 +25,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 instance
|
||||
h3#instance instance
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -34,7 +38,27 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostView
|
||||
h3#componentType componentType
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#injector injector
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#hostView hostView
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -47,7 +71,27 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 dispose
|
||||
h3#hostComponentType hostComponentType
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#hostComponent hostComponent
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#dispose dispose
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
|
|
@ -4,7 +4,13 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/component_url_mapper.ts#L4-L24">angular2/src/core/compiler/component_url_mapper.ts (line 4)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Resolve a `Type` from a <a href='ComponentMetadata-class.html'><code>ComponentMetadata</code></a> into a URL.
|
||||
|
||||
This interface can be overridden by the application developer to create custom behavior.
|
||||
|
||||
See <a href='Compiler-interface.html'><code>Compiler</code></a>
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -18,7 +24,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 getUrl
|
||||
h3#getUrl getUrl
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
|
||||
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.37/modules/angular2/src/core/forms/model.ts#L135-L165">angular2/src/core/forms/model.ts (line 135)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/model.ts#L132-L161">angular2/src/core/forms/model.ts (line 132)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Defines a part of a form that cannot be divided into other controls.
|
||||
|
||||
`Control` is one of the three fundamental building blocks used to define forms in Angular, along
|
||||
with <a href='ControlGroup-class.html'><code>ControlGroup</code></a> and <a href='ControlArray-class.html'><code>ControlArray</code></a>.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,14 +21,12 @@ p.location-badge.
|
|||
constructor(value?: any, validator?: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 updateValue
|
||||
h3#updateValue updateValue
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -32,15 +35,13 @@ p.location-badge.
|
|||
{onlySelf?: boolean, emitEvent?: boolean, emitModelToViewChange?: boolean})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registerOnChange
|
||||
h3#registerOnChange registerOnChange
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -48,8 +49,6 @@ p.location-badge.
|
|||
registerOnChange(fn: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,24 @@
|
|||
|
||||
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.37/modules/angular2/src/core/forms/model.ts#L249-L304">angular2/src/core/forms/model.ts (line 249)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/model.ts#L238-L288">angular2/src/core/forms/model.ts (line 238)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Defines a part of a form, of variable length, that can contain other controls.
|
||||
|
||||
A `ControlArray` aggregates the values and errors of each <a href='Control-class.html'><code>Control</code></a> in the group. Thus, if
|
||||
one of the controls in a group is invalid, the entire group is invalid. Similarly, if a control
|
||||
changes its value, the entire group changes as well.
|
||||
|
||||
`ControlArray` is one of the three fundamental building blocks used to define forms in Angular,
|
||||
along with <a href='Control-class.html'><code>Control</code></a> and <a href='ControlGroup-class.html'><code>ControlGroup</code></a>. <a href='ControlGroup-class.html'><code>ControlGroup</code></a> can also contain
|
||||
other controls, but is of fixed length.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,26 +26,22 @@ p.location-badge.
|
|||
constructor(controls: AbstractControl[], validator?: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 controls
|
||||
h3#controls controls
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 at
|
||||
h3#at at
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -43,15 +49,13 @@ p.location-badge.
|
|||
at(index: number)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 push
|
||||
h3#push push
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -59,15 +63,13 @@ p.location-badge.
|
|||
push(control: AbstractControl)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 insert
|
||||
h3#insert insert
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -75,15 +77,13 @@ p.location-badge.
|
|||
insert(index: number, control: AbstractControl)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 removeAt
|
||||
h3#removeAt removeAt
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -91,20 +91,16 @@ p.location-badge.
|
|||
removeAt(index: number)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 length
|
||||
h3#length length
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,40 +4,38 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/control_container.ts#L2-L13">angular2/src/core/forms/directives/control_container.ts (line 2)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
A directive that contains multiple <a href='NgControl-class.html'><code>NgControl</code></a>.
|
||||
|
||||
Only used by the forms module.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 name
|
||||
h3#name name
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 formDirective
|
||||
h3#formDirective formDirective
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 path
|
||||
h3#path path
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,24 @@
|
|||
|
||||
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.37/modules/angular2/src/core/forms/model.ts#L165-L249">angular2/src/core/forms/model.ts (line 165)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/model.ts#L161-L238">angular2/src/core/forms/model.ts (line 161)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Defines a part of a form, of fixed length, that can contain other controls.
|
||||
|
||||
A `ControlGroup` aggregates the values and errors of each <a href='Control-class.html'><code>Control</code></a> in the group. Thus, if
|
||||
one of the controls in a group is invalid, the entire group is invalid. Similarly, if a control
|
||||
changes its value, the entire group changes as well.
|
||||
|
||||
`ControlGroup` is one of the three fundamental building blocks used to define forms in Angular,
|
||||
along with <a href='Control-class.html'><code>Control</code></a> and <a href='ControlArray-class.html'><code>ControlArray</code></a>. <a href='ControlArray-class.html'><code>ControlArray</code></a> can also contain other
|
||||
controls, but is of variable length.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,42 +26,36 @@ p.location-badge.
|
|||
constructor(controls: StringMap<string, AbstractControl>, optionals?: StringMap<string, boolean>, validator?: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 controls
|
||||
h3#controls controls
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 addControl
|
||||
h3#addControl addControl
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
addControl(name: string, c: AbstractControl)
|
||||
addControl(name: string, control: AbstractControl)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 removeControl
|
||||
h3#removeControl removeControl
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -59,15 +63,13 @@ p.location-badge.
|
|||
removeControl(name: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 include
|
||||
h3#include include
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -75,15 +77,13 @@ p.location-badge.
|
|||
include(controlName: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 exclude
|
||||
h3#exclude exclude
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -91,15 +91,13 @@ p.location-badge.
|
|||
exclude(controlName: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 contains
|
||||
h3#contains contains
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -107,8 +105,6 @@ p.location-badge.
|
|||
contains(controlName: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,15 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/control_value_accessor.ts#L1-L10">angular2/src/core/forms/directives/control_value_accessor.ts (line 1)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
A bridge between a control and a native element.
|
||||
|
||||
Please see <a href='DefaultValueAccessor-class.html'><code>DefaultValueAccessor</code></a> for more information.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 writeValue
|
||||
h3#writeValue writeValue
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,15 +20,13 @@ p.location-badge.
|
|||
writeValue(obj: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registerOnChange
|
||||
h3#registerOnChange registerOnChange
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -32,15 +34,13 @@ p.location-badge.
|
|||
registerOnChange(fn: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registerOnTouched
|
||||
h3#registerOnTouched registerOnTouched
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -48,8 +48,6 @@ p.location-badge.
|
|||
registerOnTouched(fn: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,22 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/number_pipe.ts#L116-L145">angular2/src/core/pipes/number_pipe.ts (line 116)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
WARNING: this pipe uses the Internationalization API.
|
||||
Therefore it is only reliable in Chrome and Opera browsers.
|
||||
|
||||
Formats a number as local currency.
|
||||
|
||||
# Usage
|
||||
|
||||
expression | currency[:currencyCode[:symbolDisplay[:digitInfo]]]
|
||||
|
||||
where `currencyCode` is the ISO 4217 currency code, such as "USD" for the US dollar and
|
||||
"EUR" for the euro. `symbolDisplay` is a boolean indicating whether to use the currency
|
||||
symbol (e.g. $) or the currency code (e.g. USD) in the output. The default for this value
|
||||
is `false`.
|
||||
For more information about `digitInfo` see <a href='DecimalPipe-class.html'><code>DecimalPipe</code></a>
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -25,7 +40,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 transform
|
||||
h3#transform transform
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -33,8 +48,6 @@ p.location-badge.
|
|||
transform(value: any, args: any[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,29 @@
|
|||
|
||||
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.37/modules/angular2/src/core/di/exceptions.ts#L69-L93">angular2/src/core/di/exceptions.ts (line 69)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/exceptions.ts#L68-L92">angular2/src/core/di/exceptions.ts (line 68)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Thrown when dependencies form a cycle.
|
||||
|
||||
## Example:
|
||||
|
||||
```javascript
|
||||
class A {
|
||||
constructor(b:B) {}
|
||||
}
|
||||
class B {
|
||||
constructor(a:A) {}
|
||||
}
|
||||
```
|
||||
|
||||
Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,8 +31,6 @@ p.location-badge.
|
|||
constructor(injector: Injector, key: Key)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,4 @@
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/default_pipes.ts#L26-L27">angular2/src/core/pipes/default_pipes.ts (line 26)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,4 @@
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/default_pipes.ts#L24-L24">angular2/src/core/pipes/default_pipes.ts (line 24)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,4 @@
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/render/dom/dom_tokens.ts#L4-L4">angular2/src/core/render/dom/dom_tokens.ts (line 4)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,63 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/date_pipe.ts#L21-L114">angular2/src/core/pipes/date_pipe.ts (line 21)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
WARNING: this pipe uses the Internationalization API.
|
||||
Therefore it is only reliable in Chrome and Opera browsers.
|
||||
|
||||
Formats a date value to a string based on the requested format.
|
||||
|
||||
# Usage
|
||||
|
||||
expression | date[:format]
|
||||
|
||||
where `expression` is a date object or a number (milliseconds since UTC epoch) and
|
||||
`format` indicates which date/time components to include:
|
||||
|
||||
| Component | Symbol | Short Form | Long Form | Numeric | 2-digit |
|
||||
|-----------|:------:|--------------|-------------------|-----------|-----------|
|
||||
| era | G | G (AD) | GGGG (Anno Domini)| - | - |
|
||||
| year | y | - | - | y (2015) | yy (15) |
|
||||
| month | M | MMM (Sep) | MMMM (September) | M (9) | MM (09) |
|
||||
| day | d | - | - | d (3) | dd (03) |
|
||||
| weekday | E | EEE (Sun) | EEEE (Sunday) | - | - |
|
||||
| hour | j | - | - | j (13) | jj (13) |
|
||||
| hour12 | h | - | - | h (1 PM) | hh (01 PM)|
|
||||
| hour24 | H | - | - | H (13) | HH (13) |
|
||||
| minute | m | - | - | m (5) | mm (05) |
|
||||
| second | s | - | - | s (9) | ss (09) |
|
||||
| timezone | z | - | z (Pacific Standard Time)| - | - |
|
||||
| timezone | Z | Z (GMT-8:00) | - | - | - |
|
||||
|
||||
In javascript, only the components specified will be respected (not the ordering,
|
||||
punctuations, ...) and details of the the formatting will be dependent on the locale.
|
||||
On the other hand in Dart version, you can also include quoted text as well as some extra
|
||||
date/time components such as quarter. For more information see:
|
||||
https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/intl/intl.DateFormat.
|
||||
|
||||
`format` can also be one of the following predefined formats:
|
||||
|
||||
- `'medium'`: equivalent to `'yMMMdjms'` (e.g. Sep 3, 2010, 12:05:08 PM for en-US)
|
||||
- `'short'`: equivalent to `'yMdjm'` (e.g. 9/3/2010, 12:05 PM for en-US)
|
||||
- `'fullDate'`: equivalent to `'yMMMMEEEEd'` (e.g. Friday, September 3, 2010 for en-US)
|
||||
- `'longDate'`: equivalent to `'yMMMMd'` (e.g. September 3, 2010)
|
||||
- `'mediumDate'`: equivalent to `'yMMMd'` (e.g. Sep 3, 2010 for en-US)
|
||||
- `'shortDate'`: equivalent to `'yMd'` (e.g. 9/3/2010 for en-US)
|
||||
- `'mediumTime'`: equivalent to `'jms'` (e.g. 12:05:08 PM for en-US)
|
||||
- `'shortTime'`: equivalent to `'jm'` (e.g. 12:05 PM for en-US)
|
||||
|
||||
Timezone of the formatted text will be the local system timezone of the end-users machine.
|
||||
|
||||
# Examples
|
||||
|
||||
Assuming `dateObj` is (year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11)
|
||||
in the _local_ time and locale is 'en-US':
|
||||
|
||||
{{ dateObj | date }} // output is 'Jun 15, 2015'
|
||||
{{ dateObj | date:'medium' }} // output is 'Jun 15, 2015, 9:43:11 PM'
|
||||
{{ dateObj | date:'shortTime' }} // output is '9:43 PM'
|
||||
{{ dateObj | date:'mmss' }} // output is '43:11'
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -25,7 +81,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 transform
|
||||
h3#transform transform
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -33,15 +89,13 @@ p.location-badge.
|
|||
transform(value: any, args: any[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 supports
|
||||
h3#supports supports
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -49,8 +103,6 @@ p.location-badge.
|
|||
supports(obj: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,47 +4,45 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/debug/debug_element.ts#L9-L137">angular2/src/core/debug/debug_element.ts (line 9)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
A DebugElement contains information from the Angular compiler about an
|
||||
element and provides access to the corresponding ElementInjector and
|
||||
underlying dom Element, as well as a way to query for children.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 componentInstance
|
||||
h3#componentInstance componentInstance
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 nativeElement
|
||||
h3#nativeElement nativeElement
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 elementRef
|
||||
h3#elementRef elementRef
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 getDirectiveInstance
|
||||
h3#getDirectiveInstance getDirectiveInstance
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -52,15 +50,13 @@ p.location-badge.
|
|||
getDirectiveInstance(directiveIndex: number)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 children
|
||||
h3#children children
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -72,7 +68,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 componentViewChildren
|
||||
h3#componentViewChildren componentViewChildren
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -85,7 +81,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 triggerEventHandler
|
||||
h3#triggerEventHandler triggerEventHandler
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -93,15 +89,13 @@ p.location-badge.
|
|||
triggerEventHandler(eventName: string, eventObj: Event)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hasDirective
|
||||
h3#hasDirective hasDirective
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -109,15 +103,13 @@ p.location-badge.
|
|||
hasDirective(type: Type)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 inject
|
||||
h3#inject inject
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -125,15 +117,13 @@ p.location-badge.
|
|||
inject(type: Type)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 getLocal
|
||||
h3#getLocal getLocal
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -141,15 +131,13 @@ p.location-badge.
|
|||
getLocal(name: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 query
|
||||
h3#query query
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -166,7 +154,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 queryAll
|
||||
h3#queryAll queryAll
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
|
|
@ -4,7 +4,34 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/number_pipe.ts#L56-L94">angular2/src/core/pipes/number_pipe.ts (line 56)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
WARNING: this pipe uses the Internationalization API.
|
||||
Therefore it is only reliable in Chrome and Opera browsers.
|
||||
|
||||
Formats a number as local text. i.e. group sizing and seperator and other locale-specific
|
||||
configurations are based on the active locale.
|
||||
|
||||
# Usage
|
||||
|
||||
expression | number[:digitInfo]
|
||||
|
||||
where `expression` is a number and `digitInfo` has the following format:
|
||||
|
||||
{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
|
||||
|
||||
- minIntegerDigits is the minimum number of integer digits to use. Defaults to 1.
|
||||
- minFractionDigits is the minimum number of digits after fraction. Defaults to 0.
|
||||
- maxFractionDigits is the maximum number of digits after fraction. Defaults to 3.
|
||||
|
||||
For more information on the acceptable range for each of these numbers and other
|
||||
details see your native internationalization library.
|
||||
|
||||
# Examples
|
||||
|
||||
{{ 123 | number }} // output is 123
|
||||
{{ 123.1 | number: '.2-3' }} // output is 123.10
|
||||
{{ 1 | number: '2.2' }} // output is 01.00
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -25,7 +52,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 transform
|
||||
h3#transform transform
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -33,8 +60,6 @@ p.location-badge.
|
|||
transform(value: any, args: any[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/validators.ts#L7-L14">angular2/src/core/forms/directives/validators.ts (line 7)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
|
||||
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.37/modules/angular2/src/core/forms/directives/default_value_accessor.ts#L8-L73">angular2/src/core/forms/directives/default_value_accessor.ts (line 8)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/default_value_accessor.ts#L8-L71">angular2/src/core/forms/directives/default_value_accessor.ts (line 8)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
The default accessor for writing a value and listening to changes that is used by the
|
||||
<a href='NgModel-class.html'><code>NgModel</code></a>, <a href='NgFormControl-class.html'><code>NgFormControl</code></a>, and <a href='NgControlName-class.html'><code>NgControlName</code></a> directives.
|
||||
|
||||
# Example
|
||||
```
|
||||
<input type="text" [(ng-model)]="searchQuery">
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -32,7 +40,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -40,38 +48,32 @@ p.location-badge.
|
|||
constructor(cd: NgControl, _renderer: Renderer, _elementRef: ElementRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 onChange
|
||||
h3#onChange onChange
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 onTouched
|
||||
h3#onTouched onTouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 writeValue
|
||||
h3#writeValue writeValue
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -79,87 +81,73 @@ p.location-badge.
|
|||
writeValue(value: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassUntouched
|
||||
h3#ngClassUntouched ngClassUntouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassTouched
|
||||
h3#ngClassTouched ngClassTouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassPristine
|
||||
h3#ngClassPristine ngClassPristine
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassDirty
|
||||
h3#ngClassDirty ngClassDirty
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassValid
|
||||
h3#ngClassValid ngClassValid
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 ngClassInvalid
|
||||
h3#ngClassInvalid ngClassInvalid
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registerOnChange
|
||||
h3#registerOnChange registerOnChange
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -167,15 +155,13 @@ p.location-badge.
|
|||
registerOnChange(fn: (_: any) => void)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registerOnTouched
|
||||
h3#registerOnTouched registerOnTouched
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -183,8 +169,6 @@ p.location-badge.
|
|||
registerOnTouched(fn: () => void)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,10 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/binding.ts#L29-L39">angular2/src/core/di/binding.ts (line 29)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,67 +15,55 @@ p.location-badge.
|
|||
constructor(key: Key, optional: boolean, lowerBoundVisibility: any, upperBoundVisibility: any, properties: any[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 key
|
||||
h3#key key
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 optional
|
||||
h3#optional optional
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 lowerBoundVisibility
|
||||
h3#lowerBoundVisibility lowerBoundVisibility
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 upperBoundVisibility
|
||||
h3#upperBoundVisibility upperBoundVisibility
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 properties
|
||||
h3#properties properties
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,22 +1,45 @@
|
|||
|
||||
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.37/modules/angular2/src/core/di/metadata.ts#L34-L65">angular2/src/core/di/metadata.ts (line 34)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/metadata.ts#L33-L64">angular2/src/core/di/metadata.ts (line 33)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
`DependencyMetadata` is used by the framework to extend DI.
|
||||
|
||||
Only metadata implementing `DependencyMetadata` are added to the list of dependency
|
||||
properties.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
class Exclude extends DependencyMetadata {}
|
||||
class NotDependencyProperty {}
|
||||
|
||||
class AComponent {
|
||||
constructor(@Exclude @NotDependencyProperty aService:AService) {}
|
||||
}
|
||||
```
|
||||
|
||||
will create the following dependency:
|
||||
|
||||
```
|
||||
new Dependency(Key.get(AService), [new Exclude()])
|
||||
```
|
||||
|
||||
The framework can use `new Exclude()` to handle the `aService` dependency
|
||||
in a specific way.
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 token
|
||||
h3#token token
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,13 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/injector.ts#L387-L394">angular2/src/core/di/injector.ts (line 387)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Used to provide dependencies that cannot be easily expressed as bindings.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 getDependency
|
||||
h3#getDependency getDependency
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,8 +18,6 @@ p.location-badge.
|
|||
getDependency(injector: Injector, binding: ResolvedBinding, dependency: Dependency)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
.l-main-section
|
||||
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.37/modules/angular2/src/core/metadata.ts#L492-L492">angular2/src/core/metadata.ts (line 492)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L496-L496">angular2/src/core/metadata.ts (line 496)</a>
|
||||
|
||||
:markdown
|
||||
<a href='DirectiveMetadata-class.html'><code>DirectiveMetadata</code></a> factory function.
|
||||
|
|
|
@ -4,4 +4,8 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L50-L57">angular2/src/core/metadata.ts (line 50)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Interface for the <a href='DirectiveMetadata-class.html'><code>DirectiveMetadata</code></a> decorator function.
|
||||
|
||||
See <a href='DirectiveFactory-interface.html'><code>DirectiveFactory</code></a>.
|
||||
|
||||
|
||||
|
|
|
@ -4,4 +4,43 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L97-L148">angular2/src/core/metadata.ts (line 97)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
<a href='DirectiveMetadata-class.html'><code>DirectiveMetadata</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({...})
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -1,23 +1,401 @@
|
|||
|
||||
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.37/modules/angular2/src/core/metadata/directives.ts#L3-L722">angular2/src/core/metadata/directives.ts (line 3)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata/directives.ts#L3-L745">angular2/src/core/metadata/directives.ts (line 3)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Directives allow you to attach behavior to elements in the DOM.
|
||||
|
||||
<a href='DirectiveMetadata-class.html'><code>DirectiveMetadata</code></a>s with an embedded view are called <a href='ComponentMetadata-class.html'><code>ComponentMetadata</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='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='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='ViewMetadata-class.html'><code>ViewMetadata</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
|
||||
- `@Host() directive:DirectiveType`: any directive that matches the type between the current
|
||||
element and the
|
||||
Shadow DOM root.
|
||||
- `@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='DirectiveMetadata-class.html'><code>DirectiveMetadata</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 current element, the
|
||||
parent element, or its parents.
|
||||
```
|
||||
@Directive({ selector: '[my-directive]' })
|
||||
class MyDirective {
|
||||
constructor(@Host() dependency: Dependency) {
|
||||
expect(dependency.id).toEqual(2);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`@Host` checks the current element, 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='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='ViewContainerRef-interface.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='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'
|
||||
],
|
||||
host: {
|
||||
'(mouseenter)': 'onMouseEnter()',
|
||||
'(mouseleave)': '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='ViewContainerRef-interface.html'><code>ViewContainerRef</code></a> to instantiate, insert, move, and destroy views at
|
||||
runtime.
|
||||
The <a href='ViewContainerRef-interface.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='ViewMetadata-class.html'><code>ViewMetadata</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.
|
||||
|
||||
## Lifecycle hooks
|
||||
|
||||
When the directive class implements some <a href='../lifecycle_hooks'><code>undefined</code></a> the callbacks are
|
||||
called by the change detection at defined points in time during the life of the directive.
|
||||
|
||||
## 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 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor({
|
||||
selector, properties, events, host, bindings, exportAs, compileChildren = true,
|
||||
selector, properties, events, host, bindings, exportAs, moduleId,
|
||||
compileChildren = true,
|
||||
}?: {
|
||||
selector?: string,
|
||||
properties?: string[],
|
||||
|
@ -25,18 +403,17 @@ p.location-badge.
|
|||
host?: StringMap<string, string>,
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
compileChildren?: boolean,
|
||||
})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 selector
|
||||
h3#selector selector
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -77,7 +454,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 properties
|
||||
h3#properties properties
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -155,7 +532,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 events
|
||||
h3#events events
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -207,11 +584,11 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 host
|
||||
h3#host host
|
||||
|
||||
|
||||
:markdown
|
||||
Specifiy the events, actions, properties and attributes related to the host element.
|
||||
Specify the events, actions, properties and attributes related to the host element.
|
||||
|
||||
## Events
|
||||
|
||||
|
@ -220,7 +597,7 @@ p.location-badge.
|
|||
|
||||
- `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
|
||||
If the evaluation 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.
|
||||
|
@ -285,7 +662,7 @@ p.location-badge.
|
|||
}
|
||||
```
|
||||
|
||||
In this example the prop property of the host element is updated with the expression value
|
||||
In this example the `prop` property of the host element is updated with the expression value
|
||||
every time it changes.
|
||||
|
||||
## Attributes
|
||||
|
@ -316,7 +693,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 compileChildren
|
||||
h3#compileChildren compileChildren
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -329,11 +706,11 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 bindings
|
||||
h3#bindings bindings
|
||||
|
||||
|
||||
:markdown
|
||||
Defines the set of injectable objects that are visible to a Directive and its light dom
|
||||
Defines the set of injectable objects that are visible to a Directive and its light DOM
|
||||
children.
|
||||
|
||||
## Simple Example
|
||||
|
@ -369,7 +746,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 exportAs
|
||||
h3#exportAs exportAs
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -402,3 +779,31 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#moduleId moduleId
|
||||
|
||||
|
||||
:markdown
|
||||
The module id of the module that contains the directive.
|
||||
Needed to be able to resolve relative urls for templates and styles.
|
||||
In Dart, this can be determined automatically and does not need to be set.
|
||||
In CommonJS, this can always be set to `module.id`.
|
||||
|
||||
## Simple Example
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'someDir',
|
||||
moduleId: module.id
|
||||
})
|
||||
class SomeDir {
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
|
||||
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.37/modules/angular2/src/core/compiler/directive_resolver.ts#L13-L115">angular2/src/core/compiler/directive_resolver.ts (line 13)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/directive_resolver.ts#L13-L119">angular2/src/core/compiler/directive_resolver.ts (line 13)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Resolve a `Type` for <a href='DirectiveMetadata-class.html'><code>DirectiveMetadata</code></a>.
|
||||
|
||||
This interface can be overridden by the application developer to create custom behavior.
|
||||
|
||||
See <a href='Compiler-interface.html'><code>Compiler</code></a>
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -18,7 +24,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 resolve
|
||||
h3#resolve resolve
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
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.37/modules/angular2/src/core/compiler/interfaces.ts#L65-L88">angular2/src/core/compiler/interfaces.ts (line 65)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 doCheck
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
doCheck()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
|
||||
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.37/modules/angular2/src/core/compiler/interfaces.ts#L72-L93">angular2/src/core/compiler/interfaces.ts (line 72)</a>
|
||||
|
||||
:markdown
|
||||
Overrides the default change detection.
|
||||
|
||||
`doCheck()` gets called to check the changes in the directives instead of the default
|
||||
change detection mechanism.
|
||||
|
||||
It is invoked every time the change detection is triggered.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component(...)
|
||||
class MyComponent implements DoCheck {
|
||||
doCheck(): void {
|
||||
// Custom logic to detect changes
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#doCheck doCheck
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
doCheck()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,290 +0,0 @@
|
|||
|
||||
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.37/modules/angular2/src/core/render/dom/dom_renderer.ts#L34-L267">angular2/src/core/render/dom/dom_renderer.ts (line 34)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-sub-section
|
||||
h3.annotation Injectable
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Injectable()
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 createRootHostView
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
createRootHostView(hostProtoViewRef: RenderProtoViewRef, fragmentCount: number, hostElementSelector: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 createView
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
createView(protoViewRef: RenderProtoViewRef, fragmentCount: number)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 destroyView
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
destroyView(viewRef: RenderViewRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 getNativeElementSync
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getNativeElementSync(location: RenderElementRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 getRootNodes
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getRootNodes(fragment: RenderFragmentRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 attachFragmentAfterFragment
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
attachFragmentAfterFragment(previousFragmentRef: RenderFragmentRef, fragmentRef: RenderFragmentRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 attachFragmentAfterElement
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
attachFragmentAfterElement(elementRef: RenderElementRef, fragmentRef: RenderFragmentRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 detachFragment
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
detachFragment(fragmentRef: RenderFragmentRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hydrateView
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
hydrateView(viewRef: RenderViewRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 dehydrateView
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
dehydrateView(viewRef: RenderViewRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 setElementProperty
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
setElementProperty(location: RenderElementRef, propertyName: string, propertyValue: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 setElementAttribute
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
setElementAttribute(location: RenderElementRef, attributeName: string, attributeValue: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 setElementClass
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
setElementClass(location: RenderElementRef, className: string, isAdd: boolean)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 setElementStyle
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
setElementStyle(location: RenderElementRef, styleName: string, styleValue: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 invokeElementMethod
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
invokeElementMethod(location: RenderElementRef, methodName: string, args: any[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 setText
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
setText(viewRef: RenderViewRef, textNodeIndex: number, text: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 setEventDispatcher
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
setEventDispatcher(viewRef: RenderViewRef, dispatcher: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,10 +1,13 @@
|
|||
|
||||
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.37/modules/angular2/src/core/compiler/dynamic_component_loader.ts#L42-L235">angular2/src/core/compiler/dynamic_component_loader.ts (line 42)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/dynamic_component_loader.ts#L58-L257">angular2/src/core/compiler/dynamic_component_loader.ts (line 58)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Service for dynamically loading a Component into an arbitrary position in the internal Angular
|
||||
application tree.
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -18,7 +21,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -26,19 +29,17 @@ p.location-badge.
|
|||
constructor(_compiler: Compiler, _viewManager: AppViewManager)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 loadAsRoot
|
||||
h3#loadAsRoot loadAsRoot
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
loadAsRoot(typeOrBinding: Type | Binding, overrideSelector: string, injector: Injector)
|
||||
loadAsRoot(typeOrBinding: Type | Binding, overrideSelector: string, injector: Injector, onDispose?: () => void)
|
||||
|
||||
:markdown
|
||||
Loads a root component that is placed at the first element that matches the component's
|
||||
|
@ -102,7 +103,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 loadIntoLocation
|
||||
h3#loadIntoLocation loadIntoLocation
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -163,7 +164,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 loadNextToLocation
|
||||
h3#loadNextToLocation loadNextToLocation
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
|
|
@ -5,6 +5,4 @@
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/debug/debug_element_view_listener.ts#L71-L74">angular2/src/core/debug/debug_element_view_listener.ts (line 71)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,17 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/element_ref.ts#L3-L62">angular2/src/core/compiler/element_ref.ts (line 3)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
An opaque reference to the underlying element.
|
||||
|
||||
The underlying native element is a DOM Element in a browser context, 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
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,14 +22,12 @@ p.location-badge.
|
|||
constructor(parentView: ViewRef, boundElementIndex: number, renderBoundElementIndex: number, _renderer: Renderer)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 parentView
|
||||
h3#parentView parentView
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -36,7 +40,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 boundElementIndex
|
||||
h3#boundElementIndex boundElementIndex
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -51,7 +55,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 renderBoundElementIndex
|
||||
h3#renderBoundElementIndex renderBoundElementIndex
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -66,21 +70,17 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 renderView
|
||||
h3#renderView renderView
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 nativeElement
|
||||
h3#nativeElement nativeElement
|
||||
|
||||
|
||||
:markdown
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
.l-main-section
|
||||
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.37/modules/angular2/src/core/metadata.ts#L529-L529">angular2/src/core/metadata.ts (line 529)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L533-L533">angular2/src/core/metadata.ts (line 533)</a>
|
||||
|
||||
:markdown
|
||||
<a href='EventMetadata-class.html'><code>EventMetadata</code></a> factory function.
|
||||
|
|
|
@ -1,14 +1,51 @@
|
|||
|
||||
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.37/modules/angular2/src/core/facade/async.ts#L90-L157">angular2/src/core/facade/async.ts (line 90)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/facade/async.ts#L91-L147">angular2/src/core/facade/async.ts (line 91)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Use by directives and components to emit custom <a href='Event-var.html'><code>Event</code></a>s.
|
||||
|
||||
## Examples
|
||||
|
||||
In the following example, `Zippy` alternatively emits `open` and `close` events when its
|
||||
title gets clicked:
|
||||
|
||||
```
|
||||
@Component({selector: 'zippy'})
|
||||
@View({template: `
|
||||
<div class="zippy">
|
||||
<div (click)="toggle()">Toggle</div>
|
||||
<div [hidden]="!visible">
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
</div>`})
|
||||
export class Zippy {
|
||||
visible: boolean = true;
|
||||
@Event() open: EventEmitter = new EventEmitter();
|
||||
@Event() close: EventEmitter = new EventEmitter();
|
||||
|
||||
toggle() {
|
||||
this.visible = !this.visible;
|
||||
if (this.visible) {
|
||||
this.open.next(null);
|
||||
} else {
|
||||
this.close.next(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
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 observer
|
||||
h3#observer observer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,15 +53,13 @@ p.location-badge.
|
|||
observer(generator: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 toRx
|
||||
h3#toRx toRx
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -32,15 +67,13 @@ p.location-badge.
|
|||
toRx()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 next
|
||||
h3#next next
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -48,16 +81,13 @@ p.location-badge.
|
|||
next(value: any)
|
||||
|
||||
:markdown
|
||||
Emits a `value`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 throw
|
||||
h3#throw throw
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -65,16 +95,13 @@ p.location-badge.
|
|||
throw(error: any)
|
||||
|
||||
:markdown
|
||||
Emits an `error`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 return
|
||||
h3#return return
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -82,9 +109,6 @@ p.location-badge.
|
|||
return(value?: any)
|
||||
|
||||
:markdown
|
||||
Closes the stream.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,21 @@
|
|||
|
||||
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.37/modules/angular2/src/core/metadata.ts#L423-L443">angular2/src/core/metadata.ts (line 423)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L427-L447">angular2/src/core/metadata.ts (line 427)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
<a href='EventMetadata-class.html'><code>EventMetadata</code></a> factory for creating decorators.
|
||||
|
||||
## Example as TypeScript Decorator
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'sample-dir'
|
||||
})
|
||||
class SampleDir {
|
||||
@Event() event = new EventEmitter(); // Same as @Event('event') event = new EventEmitter();
|
||||
@Event("el-event") dirEvent = new EventEmitter();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -1,17 +1,31 @@
|
|||
|
||||
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.37/modules/angular2/src/core/metadata/directives.ts#L893-L913">angular2/src/core/metadata/directives.ts (line 893)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata/directives.ts#L951-L971">angular2/src/core/metadata/directives.ts (line 951)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Declare a bound event.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'sample-dir'
|
||||
})
|
||||
class SampleDir {
|
||||
@Event() event = new EventEmitter(); // Same as @Event('event') event = new EventEmitter();
|
||||
@Event("el-event") dirEvent = new EventEmitter();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -19,19 +33,15 @@ p.location-badge.
|
|||
constructor(bindingPropertyName?: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 bindingPropertyName
|
||||
h3#bindingPropertyName bindingPropertyName
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,19 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/exceptions.ts#L1-L17">angular2/src/core/change_detection/exceptions.ts (line 1)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
An error thrown if application changes model breaking the top-down data flow.
|
||||
|
||||
Angular expects that the data flows from top (root) component to child (leaf) components.
|
||||
This is known as directed acyclic graph. This allows Angular to only execute change detection
|
||||
once and prevents loops in change detection data flow.
|
||||
|
||||
This exception is only thrown in dev mode.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,8 +24,6 @@ p.location-badge.
|
|||
constructor(exp: string, oldValue: any, currValue: any, context: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,4 @@
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms.ts#L42-L42">angular2/src/core/forms.ts (line 42)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,15 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/form_interface.ts#L3-L18">angular2/src/core/forms/directives/form_interface.ts (line 3)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
An interface that <a href='NgFormModel-class.html'><code>NgFormModel</code></a> and <a href='NgForm-class.html'><code>NgForm</code></a> implement.
|
||||
|
||||
Only used by the forms module.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 addControl
|
||||
h3#addControl addControl
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,15 +20,13 @@ p.location-badge.
|
|||
addControl(dir: NgControl)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 removeControl
|
||||
h3#removeControl removeControl
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -32,15 +34,13 @@ p.location-badge.
|
|||
removeControl(dir: NgControl)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 getControl
|
||||
h3#getControl getControl
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -48,15 +48,13 @@ p.location-badge.
|
|||
getControl(dir: NgControl)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 addControlGroup
|
||||
h3#addControlGroup addControlGroup
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -64,15 +62,13 @@ p.location-badge.
|
|||
addControlGroup(dir: NgControlGroup)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 removeControlGroup
|
||||
h3#removeControlGroup removeControlGroup
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -80,15 +76,13 @@ p.location-badge.
|
|||
removeControlGroup(dir: NgControlGroup)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 getControlGroup
|
||||
h3#getControlGroup getControlGroup
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -96,15 +90,13 @@ p.location-badge.
|
|||
getControlGroup(dir: NgControlGroup)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 updateModel
|
||||
h3#updateModel updateModel
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -112,8 +104,6 @@ p.location-badge.
|
|||
updateModel(dir: NgControl, value: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,69 @@
|
|||
|
||||
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.37/modules/angular2/src/core/forms/form_builder.ts#L4-L126">angular2/src/core/forms/form_builder.ts (line 4)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/form_builder.ts#L4-L122">angular2/src/core/forms/form_builder.ts (line 4)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Creates a form object from a user-specified configuration.
|
||||
|
||||
# Example
|
||||
|
||||
```
|
||||
import {Component, View, bootstrap} from 'angular2/angular2';
|
||||
import {FormBuilder, Validators, FORM_DIRECTIVES, ControlGroup} from 'angular2/core';
|
||||
|
||||
@Component({
|
||||
selector: 'login-comp',
|
||||
viewBindings: [FormBuilder]
|
||||
})
|
||||
@View({
|
||||
template: `
|
||||
<form [control-group]="loginForm">
|
||||
Login <input control="login">
|
||||
|
||||
<div control-group="passwordRetry">
|
||||
Password <input type="password" control="password">
|
||||
Confirm password <input type="password" control="passwordConfirmation">
|
||||
</div>
|
||||
</form>
|
||||
`,
|
||||
directives: [FORM_DIRECTIVES]
|
||||
})
|
||||
class LoginComp {
|
||||
loginForm: ControlGroup;
|
||||
|
||||
constructor(builder: FormBuilder) {
|
||||
this.loginForm = builder.group({
|
||||
login: ["", Validators.required],
|
||||
|
||||
passwordRetry: builder.group({
|
||||
password: ["", Validators.required],
|
||||
passwordConfirmation: ["", Validators.required]
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bootstrap(LoginComp);
|
||||
```
|
||||
|
||||
This example creates a <a href='ControlGroup-class.html'><code>ControlGroup</code></a> that consists of a `login` <a href='Control-class.html'><code>Control</code></a>, and a
|
||||
nested <a href='ControlGroup-class.html'><code>ControlGroup</code></a> that defines a `password` and a `passwordConfirmation`
|
||||
<a href='Control-class.html'><code>Control</code></a>:
|
||||
|
||||
```
|
||||
var loginForm = builder.group({
|
||||
login: ["", Validators.required],
|
||||
|
||||
passwordRetry: builder.group({
|
||||
password: ["", Validators.required],
|
||||
passwordConfirmation: ["", Validators.required]
|
||||
})
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -18,7 +77,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 group
|
||||
h3#group group
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -26,15 +85,13 @@ p.location-badge.
|
|||
group(controlsConfig: StringMap<string, any>, extra?: StringMap<string, any>)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 control
|
||||
h3#control control
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -42,15 +99,13 @@ p.location-badge.
|
|||
control(value: Object, validator?: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 array
|
||||
h3#array array
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -58,8 +113,6 @@ p.location-badge.
|
|||
array(controlsConfig: any[], validator?: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,4 +4,3 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/forward_ref.ts#L1-L3">angular2/src/core/di/forward_ref.ts (line 1)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
.l-main-section
|
||||
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.37/modules/angular2/src/core/metadata.ts#L534-L534">angular2/src/core/metadata.ts (line 534)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L538-L538">angular2/src/core/metadata.ts (line 538)</a>
|
||||
|
||||
:markdown
|
||||
<a href='HostBindingMetadata-class.html'><code>HostBindingMetadata</code></a> factory function.
|
||||
|
|
|
@ -1,7 +1,21 @@
|
|||
|
||||
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.37/modules/angular2/src/core/metadata.ts#L443-L463">angular2/src/core/metadata.ts (line 443)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L447-L467">angular2/src/core/metadata.ts (line 447)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
<a href='HostBindingMetadata-class.html'><code>HostBindingMetadata</code></a> factory for creating decorators.
|
||||
|
||||
## Example as TypeScript Decorator
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'sample-dir'
|
||||
})
|
||||
class SampleDir {
|
||||
@HostBinding() prop1; // Same as @HostBinding('prop1') prop1;
|
||||
@HostBinding("el-prop") prop1;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -1,17 +1,44 @@
|
|||
|
||||
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.37/modules/angular2/src/core/metadata/directives.ts#L913-L946">angular2/src/core/metadata/directives.ts (line 913)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata/directives.ts#L971-L1004">angular2/src/core/metadata/directives.ts (line 971)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Declare a host property binding.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'sample-dir'
|
||||
})
|
||||
class SampleDir {
|
||||
@HostBinding() prop1; // Same as @HostBinding('prop1') prop1;
|
||||
@HostBinding("el-prop") prop2;
|
||||
}
|
||||
```
|
||||
|
||||
This is equivalent to
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'sample-dir',
|
||||
host: {'[prop1]': 'prop1', '[el-prop]': 'prop2'}
|
||||
})
|
||||
class SampleDir {
|
||||
prop1;
|
||||
prop2;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -19,19 +46,15 @@ p.location-badge.
|
|||
constructor(hostPropertyName?: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostPropertyName
|
||||
h3#hostPropertyName hostPropertyName
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,4 +4,6 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/decorators.ts#L41-L49">angular2/src/core/di/decorators.ts (line 41)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Factory for creating <a href='HostMetadata-class.html'><code>HostMetadata</code></a>.
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
.l-main-section
|
||||
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.37/modules/angular2/src/core/metadata.ts#L539-L539">angular2/src/core/metadata.ts (line 539)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L543-L543">angular2/src/core/metadata.ts (line 543)</a>
|
||||
|
||||
:markdown
|
||||
<a href='HostListenerMetadata-class.html'><code>HostListenerMetadata</code></a> factory function.
|
||||
|
|
|
@ -1,7 +1,20 @@
|
|||
|
||||
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.37/modules/angular2/src/core/metadata.ts#L463-L482">angular2/src/core/metadata.ts (line 463)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L467-L486">angular2/src/core/metadata.ts (line 467)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
<a href='HostListenerMetadata-class.html'><code>HostListenerMetadata</code></a> factory for creating decorators.
|
||||
|
||||
## Example as TypeScript Decorator
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'sample-dir'
|
||||
})
|
||||
class SampleDir {
|
||||
@HostListener("change", ['$event.target.value']) onChange(value){}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -1,17 +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.37/modules/angular2/src/core/metadata/directives.ts#L946-L977">angular2/src/core/metadata/directives.ts (line 946)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata/directives.ts#L1004-L1035">angular2/src/core/metadata/directives.ts (line 1004)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Declare a host listener.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'sample-dir'
|
||||
})
|
||||
class SampleDir {
|
||||
@HostListener("change", ['$event.target.value']) onChange(value){}
|
||||
}
|
||||
```
|
||||
|
||||
This is equivalent to
|
||||
|
||||
```
|
||||
@Directive({
|
||||
selector: 'sample-dir',
|
||||
host: {'(change)': 'onChange($event.target.value)'}
|
||||
})
|
||||
class SampleDir {
|
||||
onChange(value){}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -19,31 +44,25 @@ p.location-badge.
|
|||
constructor(eventName: string, args?: string[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 eventName
|
||||
h3#eventName eventName
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 args
|
||||
h3#args args
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,17 +1,39 @@
|
|||
|
||||
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.37/modules/angular2/src/core/di/metadata.ts#L138-L166">angular2/src/core/di/metadata.ts (line 138)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/metadata.ts#L137-L165">angular2/src/core/di/metadata.ts (line 137)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Specifies that an injector should retrieve a dependency from any injector until reaching the
|
||||
closest host.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
class Dependency {
|
||||
}
|
||||
|
||||
class NeedsDependency {
|
||||
constructor(public @Host() dependency:Dependency) {}
|
||||
}
|
||||
|
||||
var parent = Injector.resolveAndCreate([
|
||||
bind(Dependency).toClass(HostDependency)
|
||||
]);
|
||||
var child = parent.resolveAndCreateChild([]);
|
||||
var grandChild = child.resolveAndCreateChild([NeedsDependency, Depedency]);
|
||||
var nd = grandChild.get(NeedsDependency);
|
||||
expect(nd.dependency).toBeAnInstanceOf(HostDependency);
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 toString
|
||||
h3#toString toString
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -19,8 +41,6 @@ p.location-badge.
|
|||
toString()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,4 +4,3 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/view_ref.ts#L13-L15">angular2/src/core/compiler/view_ref.ts (line 13)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
|
|
|
@ -4,4 +4,6 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/decorators.ts#L9-L17">angular2/src/core/di/decorators.ts (line 9)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Factory for creating <a href='InjectMetadata-class.html'><code>InjectMetadata</code></a>.
|
||||
|
||||
|
||||
|
|
|
@ -1,17 +1,25 @@
|
|||
|
||||
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.37/modules/angular2/src/core/di/metadata.ts#L1-L17">angular2/src/core/di/metadata.ts (line 1)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/metadata.ts#L1-L16">angular2/src/core/di/metadata.ts (line 1)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
A parameter metadata that specifies a dependency.
|
||||
|
||||
```
|
||||
class AComponent {
|
||||
constructor(@Inject(MyService) aService:MyService) {}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -19,26 +27,22 @@ p.location-badge.
|
|||
constructor(token: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 token
|
||||
h3#token token
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 toString
|
||||
h3#toString toString
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -46,8 +50,6 @@ p.location-badge.
|
|||
toString()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,4 +4,6 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/decorators.ts#L25-L33">angular2/src/core/di/decorators.ts (line 25)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Factory for creating <a href='InjectableMetadata-class.html'><code>InjectableMetadata</code></a>.
|
||||
|
||||
|
||||
|
|
|
@ -1,17 +1,29 @@
|
|||
|
||||
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.37/modules/angular2/src/core/di/metadata.ts#L65-L83">angular2/src/core/di/metadata.ts (line 65)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/metadata.ts#L64-L82">angular2/src/core/di/metadata.ts (line 64)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
A marker metadata that marks a class as available to `Injector` for creation. Used by tooling
|
||||
for generating constructor stubs.
|
||||
|
||||
```
|
||||
class NeedsService {
|
||||
constructor(svc:UsefulService) {}
|
||||
}
|
||||
|
||||
@Injectable
|
||||
class UsefulService {}
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -19,8 +31,6 @@ p.location-badge.
|
|||
constructor()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,48 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/injector.ts#L394-L831">angular2/src/core/di/injector.ts (line 394)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
A dependency injection container used for resolving dependencies.
|
||||
|
||||
An `Injector` is a replacement for a `new` operator, which can automatically resolve the
|
||||
constructor dependencies.
|
||||
In typical use, application code asks for the dependencies in the constructor and they are
|
||||
resolved by the `Injector`.
|
||||
|
||||
## Example:
|
||||
|
||||
Suppose that we want to inject an `Engine` into class `Car`, we would define it like this:
|
||||
|
||||
```javascript
|
||||
class Engine {
|
||||
}
|
||||
|
||||
class Car {
|
||||
constructor(@Inject(Engine) engine) {
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Next we need to write the code that creates and instantiates the `Injector`. We then ask for the
|
||||
`root` object, `Car`, so that the `Injector` can recursively build all of that object's
|
||||
dependencies.
|
||||
|
||||
```javascript
|
||||
main() {
|
||||
var injector = Injector.resolveAndCreate([Car, Engine]);
|
||||
|
||||
// Get a reference to the `root` object, which will recursively instantiate the tree.
|
||||
var car = injector.get(Car);
|
||||
}
|
||||
```
|
||||
Notice that we don't use the `new` operator because we explicitly want to have the `Injector`
|
||||
resolve all of the object's dependencies automatically.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,14 +53,12 @@ p.location-badge.
|
|||
constructor(_proto: ProtoInjector, _parent?: Injector, _depProvider?: DependencyProvider, _debugContext?: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 debugContext
|
||||
h3#debugContext debugContext
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -42,7 +77,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 get
|
||||
h3#get get
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -58,7 +93,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 getOptional
|
||||
h3#getOptional getOptional
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -74,7 +109,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 getAt
|
||||
h3#getAt getAt
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -90,7 +125,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 parent
|
||||
h3#parent parent
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -103,7 +138,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 internalStrategy
|
||||
h3#internalStrategy internalStrategy
|
||||
|
||||
|
||||
:markdown
|
||||
|
@ -118,7 +153,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 resolveAndCreateChild
|
||||
h3#resolveAndCreateChild resolveAndCreateChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -138,7 +173,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 createChildFromResolved
|
||||
h3#createChildFromResolved createChildFromResolved
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -154,7 +189,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 resolveAndInstantiate
|
||||
h3#resolveAndInstantiate resolveAndInstantiate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -170,7 +205,7 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 instantiateResolved
|
||||
h3#instantiateResolved instantiateResolved
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -186,19 +221,17 @@ p.location-badge.
|
|||
|
||||
|
||||
.l-sub-section
|
||||
h3 displayName
|
||||
h3#displayName displayName
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 toString
|
||||
h3#toString toString
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -206,8 +239,6 @@ p.location-badge.
|
|||
toString()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
|
||||
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.37/modules/angular2/src/core/di/exceptions.ts#L93-L125">angular2/src/core/di/exceptions.ts (line 93)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/exceptions.ts#L92-L123">angular2/src/core/di/exceptions.ts (line 92)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Thrown when a constructing type returns with an Error.
|
||||
|
||||
The `InstantiationError` class contains the original error plus the dependency graph which caused
|
||||
this object to be instantiated.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,50 +21,32 @@ p.location-badge.
|
|||
constructor(injector: Injector, originalException: any, originalStack: any, key: Key)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 name
|
||||
h3#keys keys
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 keys
|
||||
h3#injectors injectors
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 injectors
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 addKey
|
||||
h3#addKey addKey
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -67,44 +54,36 @@ p.location-badge.
|
|||
addKey(injector: Injector, key: Key)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 wrapperMessage
|
||||
h3#wrapperMessage wrapperMessage
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 causeKey
|
||||
h3#causeKey causeKey
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 context
|
||||
h3#context context
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
|
||||
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.37/modules/angular2/src/core/di/exceptions.ts#L125-L140">angular2/src/core/di/exceptions.ts (line 125)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/exceptions.ts#L123-L134">angular2/src/core/di/exceptions.ts (line 123)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Thrown when an object other then <a href='Binding-class.html'><code>Binding</code></a> (or `Type`) is passed to <a href='Injector-class.html'><code>Injector</code></a>
|
||||
creation.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,36 +19,6 @@ p.location-badge.
|
|||
constructor(binding: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 message
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 toString
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
toString()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,10 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/differs/iterable_differs.ts#L5-L10">angular2/src/core/change_detection/differs/iterable_differs.ts (line 5)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 diff
|
||||
h3#diff diff
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,15 +15,13 @@ p.location-badge.
|
|||
diff(object: Object)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 onDestroy
|
||||
h3#onDestroy onDestroy
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -32,8 +29,6 @@ p.location-badge.
|
|||
onDestroy()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,13 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/differs/iterable_differs.ts#L10-L18">angular2/src/core/change_detection/differs/iterable_differs.ts (line 10)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Provides a factory for <a href='IterableDiffer-interface.html'><code>IterableDiffer</code></a>.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 supports
|
||||
h3#supports supports
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,15 +18,13 @@ p.location-badge.
|
|||
supports(objects: Object)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 create
|
||||
h3#create create
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -32,8 +32,6 @@ p.location-badge.
|
|||
create(cdRef: ChangeDetectorRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,9 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/differs/iterable_differs.ts#L18-L81">angular2/src/core/change_detection/differs/iterable_differs.ts (line 18)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
A repository of different iterable diffing strategies used by NgFor, NgClass, and others.
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -18,7 +20,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -26,26 +28,22 @@ p.location-badge.
|
|||
constructor(factories: IterableDifferFactory[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 factories
|
||||
h3#factories factories
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 find
|
||||
h3#find find
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -53,8 +51,6 @@ p.location-badge.
|
|||
find(iterable: Object)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,29 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/json_pipe.ts#L4-L34">angular2/src/core/pipes/json_pipe.ts (line 4)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Implements json transforms to any object.
|
||||
|
||||
# Example
|
||||
|
||||
In this example we transform the user object to json.
|
||||
|
||||
```
|
||||
@Component({
|
||||
selector: "user-cmp"
|
||||
})
|
||||
@View({
|
||||
template: "User: {{ user | json }}"
|
||||
})
|
||||
class Username {
|
||||
user:Object
|
||||
constructor() {
|
||||
this.user = { name: "PatrickJS" };
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -25,7 +47,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 transform
|
||||
h3#transform transform
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -33,8 +55,6 @@ p.location-badge.
|
|||
transform(value: any, args?: any[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,20 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/key.ts#L7-L37">angular2/src/core/di/key.ts (line 7)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
A unique object used for retrieving items from the <a href='Injector-class.html'><code>Injector</code></a>.
|
||||
|
||||
Keys have:
|
||||
- a system-wide unique `id`.
|
||||
- a `token`, usually the `Type` of the instance.
|
||||
|
||||
Keys are used internally by the <a href='Injector-class.html'><code>Injector</code></a> because their system-wide unique `id`s allow the
|
||||
injector to index in arrays rather than looking up items in maps.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,43 +25,35 @@ p.location-badge.
|
|||
constructor(token: Object, id: number)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 token
|
||||
h3#token token
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 id
|
||||
h3#id id
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 displayName
|
||||
h3#displayName displayName
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,10 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/key.ts#L37-L65">angular2/src/core/di/key.ts (line 37)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 get
|
||||
h3#get get
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,20 +15,16 @@ p.location-badge.
|
|||
get(token: Object)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 numberOfKeys
|
||||
h3#numberOfKeys numberOfKeys
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,10 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/differs/keyvalue_differs.ts#L5-L10">angular2/src/core/change_detection/differs/keyvalue_differs.ts (line 5)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 diff
|
||||
h3#diff diff
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,15 +15,13 @@ p.location-badge.
|
|||
diff(object: Object)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 onDestroy
|
||||
h3#onDestroy onDestroy
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -32,8 +29,6 @@ p.location-badge.
|
|||
onDestroy()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,13 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/differs/keyvalue_differs.ts#L10-L18">angular2/src/core/change_detection/differs/keyvalue_differs.ts (line 10)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Provides a factory for <a href='KeyValueDiffer-interface.html'><code>KeyValueDiffer</code></a>.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 supports
|
||||
h3#supports supports
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -16,15 +18,13 @@ p.location-badge.
|
|||
supports(objects: Object)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 create
|
||||
h3#create create
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -32,8 +32,6 @@ p.location-badge.
|
|||
create(cdRef: ChangeDetectorRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,9 @@ p.location-badge.
|
|||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/differs/keyvalue_differs.ts#L18-L81">angular2/src/core/change_detection/differs/keyvalue_differs.ts (line 18)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -18,7 +20,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -26,26 +28,22 @@ p.location-badge.
|
|||
constructor(factories: KeyValueDifferFactory[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 factories
|
||||
h3#factories factories
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 find
|
||||
h3#find find
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -53,8 +51,6 @@ p.location-badge.
|
|||
find(kv: Object)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +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.37/modules/angular2/src/core/life_cycle/life_cycle.ts#L6-L90">angular2/src/core/life_cycle/life_cycle.ts (line 6)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/life_cycle/life_cycle.ts#L6-L92">angular2/src/core/life_cycle/life_cycle.ts (line 6)</a>
|
||||
|
||||
:markdown
|
||||
Starting point to import all public core APIs.
|
||||
Provides access to explicitly trigger change detection in an application.
|
||||
|
||||
By default, `Zone` triggers change detection in Angular on each virtual machine (VM) turn. When
|
||||
testing, or in some
|
||||
limited application use cases, a developer can also trigger change detection with the
|
||||
`lifecycle.tick()` method.
|
||||
|
||||
Each Angular application has a single `LifeCycle` instance.
|
||||
|
||||
# Example
|
||||
|
||||
This is a contrived example, since the bootstrap automatically runs inside of the `Zone`, which
|
||||
invokes
|
||||
`lifecycle.tick()` on your behalf.
|
||||
|
||||
```javascript
|
||||
bootstrap(MyApp).then((ref:ComponentRef) => {
|
||||
var lifeCycle = ref.injector.get(LifeCycle);
|
||||
var myApp = ref.instance;
|
||||
|
||||
ref.doSomething();
|
||||
lifecycle.tick();
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
|
@ -18,7 +43,7 @@ p.location-badge.
|
|||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
@ -26,14 +51,12 @@ p.location-badge.
|
|||
constructor(changeDetector?: ChangeDetector, enforceNoNewChanges?: boolean)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 tick
|
||||
h3#tick tick
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue