router api docs
This commit is contained in:
parent
cf7bc21acd
commit
916d5a154f
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/di.js#L53">angular2/src/core/annotations/di.js (line 53)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/di.js#L31">angular2/src/core/annotations/di.js (line 31)</a>
|
||||
|
||||
:markdown
|
||||
Specifies that a constant attribute value should be injected.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/annotations.js#L521">angular2/src/core/annotations/annotations.js (line 521)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/annotations.js#L547">angular2/src/core/annotations/annotations.js (line 547)</a>
|
||||
|
||||
:markdown
|
||||
Declare reusable UI building blocks for an application.
|
||||
|
@ -45,18 +45,20 @@ p.location-badge.
|
|||
pre.prettyprint
|
||||
code.
|
||||
constructor({
|
||||
selector,
|
||||
properties,
|
||||
events,
|
||||
hostListeners,
|
||||
injectables,
|
||||
lifecycle,
|
||||
changeDetection = DEFAULT
|
||||
selector,
|
||||
properties,
|
||||
events,
|
||||
hostListeners,
|
||||
hostProperties,
|
||||
injectables,
|
||||
lifecycle,
|
||||
changeDetection = DEFAULT
|
||||
}:{
|
||||
selector:string,
|
||||
properties:Object,
|
||||
events:List,
|
||||
hostListeners:Object,
|
||||
hostListeners:any,
|
||||
hostProperties:any,
|
||||
injectables:List,
|
||||
lifecycle:List,
|
||||
changeDetection:string
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/annotations.js#L755">angular2/src/core/annotations/annotations.js (line 755)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/annotations.js#L787">angular2/src/core/annotations/annotations.js (line 787)</a>
|
||||
|
||||
:markdown
|
||||
Directive that attaches behavior to DOM elements.
|
||||
|
@ -74,6 +74,7 @@ p.location-badge.
|
|||
properties,
|
||||
events,
|
||||
hostListeners,
|
||||
hostProperties,
|
||||
lifecycle,
|
||||
compileChildren = true,
|
||||
}:{
|
||||
|
@ -81,6 +82,7 @@ p.location-badge.
|
|||
properties:any,
|
||||
events:List,
|
||||
hostListeners:any,
|
||||
hostProperties:any,
|
||||
lifecycle:List,
|
||||
compileChildren:boolean
|
||||
}={})
|
||||
|
|
|
@ -53,7 +53,7 @@ p.location-badge.
|
|||
|
||||
To inject element-specific special objects, declare the constructor parameter as:
|
||||
- `element: NgElement` to obtain a DOM element (DEPRECATED: replacement coming)
|
||||
- `viewContainer: ViewContainer` to control child template instantiation, for <a href='Viewport-class.html'><code>Viewport</code></a> directives only
|
||||
- `viewContainer: ViewContainerRef` to control child template instantiation, for <a href='Viewport-class.html'><code>Viewport</code></a> directives only
|
||||
- `bindingPropagation: BindingPropagation` to control change detection in a more granular way.
|
||||
|
||||
## Example
|
||||
|
@ -185,8 +185,8 @@ p.location-badge.
|
|||
|
||||
|
||||
A directive can also query for other child directives. Since parent directives are instantiated before child
|
||||
directives, a directive can't simply inject the list of child directives. Instead, the directive
|
||||
injects a <a href='../view/QueryList-class.html'><code>QueryList</code></a>, which updates its contents as children are added, removed, or moved by any
|
||||
directives, a directive can't simply inject the list of child directives. Instead, the directive
|
||||
injects a <a href='../view/QueryList-class.html'><code>QueryList</code></a>, which updates its contents as children are added, removed, or moved by any
|
||||
<a href='Viewport-class.html'><code>Viewport</code></a> directive such as a `for`, an `if`, or a `switch`.
|
||||
|
||||
```
|
||||
|
@ -197,7 +197,7 @@ p.location-badge.
|
|||
}
|
||||
```
|
||||
|
||||
This directive would be instantiated with a <a href='../view/QueryList-class.html'><code>QueryList</code></a> which contains `Dependency` 4 and 6. Here, `Dependency`
|
||||
This directive would be instantiated with a <a href='../view/QueryList-class.html'><code>QueryList</code></a> which contains `Dependency` 4 and 6. Here, `Dependency`
|
||||
5 would not be included, because it is not a direct child.
|
||||
|
||||
### Injecting a live collection of descendant directives
|
||||
|
@ -246,12 +246,14 @@ p.location-badge.
|
|||
properties,
|
||||
events,
|
||||
hostListeners,
|
||||
hostProperties,
|
||||
lifecycle
|
||||
}:{
|
||||
selector:string,
|
||||
properties:any,
|
||||
events:List,
|
||||
hostListeners: any,
|
||||
hostProperties: any,
|
||||
lifecycle:List
|
||||
}={})
|
||||
|
||||
|
@ -369,6 +371,34 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 hostProperties
|
||||
|
||||
|
||||
:markdown
|
||||
Specifies which DOM properties a directives updates.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
@Decorator({
|
||||
selector: 'input',
|
||||
hostProperties: {
|
||||
'value': 'value'
|
||||
}
|
||||
})
|
||||
class InputDecorator {
|
||||
value:string;
|
||||
}
|
||||
|
||||
In this example every time the value property of the decorator changes, Angular will update the value property of
|
||||
the host element.
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 lifecycle
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/annotations.js#L660">angular2/src/core/annotations/annotations.js (line 660)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/annotations.js#L689">angular2/src/core/annotations/annotations.js (line 689)</a>
|
||||
|
||||
:markdown
|
||||
Directive used for dynamically loading components.
|
||||
|
@ -57,17 +57,19 @@ p.location-badge.
|
|||
pre.prettyprint
|
||||
code.
|
||||
constructor({
|
||||
selector,
|
||||
properties,
|
||||
events,
|
||||
hostListeners,
|
||||
injectables,
|
||||
lifecycle
|
||||
selector,
|
||||
properties,
|
||||
events,
|
||||
hostListeners,
|
||||
hostProperties,
|
||||
injectables,
|
||||
lifecycle
|
||||
}:{
|
||||
selector:string,
|
||||
properties:Object,
|
||||
properties:any,
|
||||
events:List,
|
||||
hostListeners:Object,
|
||||
hostListeners:any,
|
||||
hostProperties:any,
|
||||
injectables:List,
|
||||
lifecycle:List
|
||||
}={})
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/di.js#L77">angular2/src/core/annotations/di.js (line 77)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/di.js#L55">angular2/src/core/annotations/di.js (line 55)</a>
|
||||
|
||||
:markdown
|
||||
Specifies that a <a href='../view/QueryList-class.html'><code>QueryList</code></a> should be injected.
|
||||
|
|
|
@ -108,7 +108,7 @@ p.location-badge.
|
|||
:markdown
|
||||
Specifies an inline template for an angular component.
|
||||
|
||||
NOTE: either `templateURL` or `template` should be used, but not both.
|
||||
NOTE: either `templateUrl` or `template` should be used, but not both.
|
||||
|
||||
|
||||
|
||||
|
@ -121,7 +121,7 @@ p.location-badge.
|
|||
:markdown
|
||||
Specifies a template URL for an angular component.
|
||||
|
||||
NOTE: either `templateURL` or `template` should be used, but not both.
|
||||
NOTE: either `templateUrl` or `template` should be used, but not both.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/annotations.js#L884">angular2/src/core/annotations/annotations.js (line 884)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/annotations.js#L919">angular2/src/core/annotations/annotations.js (line 919)</a>
|
||||
|
||||
:markdown
|
||||
Directive that controls the instantiation, destruction, and positioning of inline template elements.
|
||||
|
||||
A viewport directive uses a <a href='../view/ViewContainer-class.html'><code>ViewContainer</code></a> to instantiate, insert, move, and destroy views at runtime.
|
||||
The <a href='../view/ViewContainer-class.html'><code>ViewContainer</code></a> is created as a result of `<template>` element, and represents a location in the current view
|
||||
A viewport directive uses a <a href='../view/ViewContainerRef-class.html'><code>ViewContainerRef</code></a> to instantiate, insert, move, and destroy views at runtime.
|
||||
The <a href='../view/ViewContainerRef-class.html'><code>ViewContainerRef</code></a> is created as a result of `<template>` element, and represents a location in the current view
|
||||
where these actions are performed.
|
||||
|
||||
Views are always created as children of the current <a href='View-class.html'><code>View</code></a>, and as siblings of the `<template>` element. Thus a
|
||||
|
@ -52,10 +52,10 @@ p.location-badge.
|
|||
}
|
||||
})
|
||||
export class Unless {
|
||||
viewContainer: ViewContainer;
|
||||
viewContainer: ViewContainerRef;
|
||||
prevCondition: boolean;
|
||||
|
||||
constructor(viewContainer: ViewContainer) {
|
||||
constructor(viewContainer: ViewContainerRef) {
|
||||
this.viewContainer = viewContainer;
|
||||
this.prevCondition = null;
|
||||
}
|
||||
|
@ -107,12 +107,15 @@ p.location-badge.
|
|||
properties,
|
||||
events,
|
||||
hostListeners,
|
||||
hostProperties,
|
||||
lifecycle
|
||||
}:{
|
||||
selector:string,
|
||||
properties:any,
|
||||
events:List,
|
||||
lifecycle:List
|
||||
selector:string,
|
||||
properties:any,
|
||||
hostListeners:any,
|
||||
hostProperties:any,
|
||||
events:List,
|
||||
lifecycle:List
|
||||
}={})
|
||||
|
||||
:markdown
|
||||
|
|
|
@ -36,10 +36,6 @@
|
|||
"title" : "onAllChangesDone Var"
|
||||
},
|
||||
|
||||
"PropertySetter-class" : {
|
||||
"title" : "PropertySetter Class"
|
||||
},
|
||||
|
||||
"Attribute-class" : {
|
||||
"title" : "Attribute Class"
|
||||
},
|
||||
|
|
|
@ -22,7 +22,7 @@ p.location-badge.
|
|||
|
||||
# Example
|
||||
```javascript
|
||||
bootstrap(MyApp, [bind(ChangeDetection).toValue(dynamicChangeDetection)]);
|
||||
bootstrap(MyApp, [bind(ChangeDetection).toClass(DynamicChangeDetection)]);
|
||||
```
|
||||
.l-main-section
|
||||
h2 Members
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/change_detection.html">angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/change_detection.js#L51">angular2/src/change_detection/change_detection.js (line 51)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/change_detection.js#L55">angular2/src/change_detection/change_detection.js (line 55)</a>
|
||||
|
||||
:markdown
|
||||
Implements change detection that does not require `eval()`.
|
||||
|
||||
This is slower than <a href='JitChangeDetection-class.html'><code>JitChangeDetection</code></a>.
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/change_detection.html">angular2/change_detection</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/change_detection.js#L68">angular2/src/change_detection/change_detection.js (line 68)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/change_detection/change_detection.js#L76">angular2/src/change_detection/change_detection.js (line 76)</a>
|
||||
|
||||
:markdown
|
||||
Implements faster change detection, by generating source code.
|
||||
|
||||
This requires `eval()`. For change detection that does not require `eval()`, see <a href='DynamicChangeDetection-class.html'><code>DynamicChangeDetection</code></a>.
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"index" : {
|
||||
"title" : "Core"
|
||||
"title" : "Core",
|
||||
"intro" : "Define angular core API here."
|
||||
},
|
||||
|
||||
"bootstrap-function" : {
|
||||
|
|
|
@ -29,6 +29,17 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 displayName
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 get
|
||||
|
||||
|
@ -55,17 +66,6 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 metadata
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 numberOfKeys
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(viewContainer:ViewContainer)
|
||||
constructor(viewContainer:ViewContainerRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(viewContainer: ViewContainer)
|
||||
constructor(viewContainer: ViewContainerRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(viewContainer: ViewContainer, sswitch: Switch)
|
||||
constructor(viewContainer: ViewContainerRef, sswitch: Switch)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(viewContainer: ViewContainer, sswitch: Switch)
|
||||
constructor(viewContainer: ViewContainerRef, sswitch: Switch)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/forms.html">angular2/forms</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/forms/directives.js#L62">angular2/src/forms/directives.js (line 62)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/forms/directives.js#L68">angular2/src/forms/directives.js (line 68)</a>
|
||||
|
||||
:markdown
|
||||
The accessor for writing a value and listening to changes on a checkbox input element.
|
||||
|
@ -20,7 +20,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(cd:ControlDirective, setCheckedProperty:Function)
|
||||
constructor(cd:ControlDirective, elementRef:ElementRef, renderer:Renderer)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -28,6 +28,17 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 checked
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 onChange
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/forms.html">angular2/forms</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/forms/directives.js#L114">angular2/src/forms/directives.js (line 114)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/forms/directives.js#L125">angular2/src/forms/directives.js (line 125)</a>
|
||||
|
||||
:markdown
|
||||
Binds a control to a DOM element.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/forms.html">angular2/forms</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/forms/directives.js#L210">angular2/src/forms/directives.js (line 210)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/forms/directives.js#L221">angular2/src/forms/directives.js (line 221)</a>
|
||||
|
||||
:markdown
|
||||
Binds a control group to a DOM element.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/forms.html">angular2/forms</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/forms/directives.js#L31">angular2/src/forms/directives.js (line 31)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/forms/directives.js#L35">angular2/src/forms/directives.js (line 35)</a>
|
||||
|
||||
:markdown
|
||||
The default accessor for writing a value and listening to changes that is used by a <a href='Control-class.html'><code>Control</code></a> directive.
|
||||
|
@ -21,7 +21,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(setValueProperty:Function)
|
||||
constructor()
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -40,6 +40,17 @@ p.location-badge.
|
|||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 value
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 writeValue
|
||||
|
||||
|
|
|
@ -0,0 +1,253 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/router.html">angular2/router</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/router/router.js#L18">angular2/src/router/router.js (line 18)</a>
|
||||
|
||||
:markdown
|
||||
# Router
|
||||
The router is responsible for mapping URLs to components.
|
||||
|
||||
You can see the state of the router by inspecting the read-only field `router.navigating`.
|
||||
This may be useful for showing a spinner, for instance.
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(registry:RouteRegistry, pipeline:Pipeline, parent:Router = null, name = '/')
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 activateOutlets
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
activateOutlets(instruction:Instruction)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 childRouter
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
childRouter(outletName = 'default')
|
||||
|
||||
:markdown
|
||||
Constructs a child router. You probably don't need to use this unless you're writing a reusable component.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 config
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
config(path:string, component, alias:string=null)
|
||||
|
||||
:markdown
|
||||
Update the routing configuration and trigger a navigation.
|
||||
|
||||
# Usage
|
||||
|
||||
```
|
||||
router.config('/', SomeCmp);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 generate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
generate(name:string, params:any)
|
||||
|
||||
:markdown
|
||||
Generate a URL from a component name and optional map of parameters. The URL is relative to the app's base href.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 getRoot
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getRoot()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 lastNavigationAttempt
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 name
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 navigate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
navigate(url:string)
|
||||
|
||||
:markdown
|
||||
Navigate to a URL. Returns a promise that resolves to the canonical URL for the route.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 navigating
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 parent
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 previousUrl
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 recognize
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
recognize(url:string)
|
||||
|
||||
:markdown
|
||||
Given a URL, returns an instruction representing the component graph
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 registerOutlet
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
registerOutlet(outlet:RouterOutlet, name = 'default')
|
||||
|
||||
:markdown
|
||||
Register an object to notify of route changes. You probably don't need to use this unless you're writing a reusable component.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 renavigate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
renavigate()
|
||||
|
||||
:markdown
|
||||
Navigates to either the last URL successfully navigated to, or the last URL requested if the router has yet to successfully navigate.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 subscribe
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
subscribe(onNext)
|
||||
|
||||
:markdown
|
||||
Subscribe to URL updates from the router
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 traverseOutlets
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
traverseOutlets(fn)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/router.html">angular2/router</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/router/router_link.js#L36">angular2/src/router/router_link.js (line 36)</a>
|
||||
|
||||
:markdown
|
||||
The RouterLink directive lets you link to specific parts of your app.
|
||||
|
||||
|
||||
Consider the following route configuration:
|
||||
|
||||
```
|
||||
@RouteConfig({
|
||||
path: '/user', component: UserCmp, alias: 'user'
|
||||
});
|
||||
class MyComp {}
|
||||
```
|
||||
|
||||
When linking to a route, you can write:
|
||||
|
||||
```
|
||||
<a router-link="user">link to user component</a>
|
||||
```
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(ngEl:NgElement, router:Router)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 params
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
params(changes)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 route
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
route(changes)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 updateHref
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
updateHref()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"index" : {
|
||||
"title" : "Router",
|
||||
"intro" : "Maps application URLs into application states, to support deep-linking and navigation."
|
||||
},
|
||||
|
||||
"Router-class" : {
|
||||
"title" : "Router Class"
|
||||
},
|
||||
|
||||
"RouterLink-class" : {
|
||||
"title" : "RouterLink Class"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
ul
|
||||
for page, slug in public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]]._data
|
||||
if slug != 'index'
|
||||
url = "/docs/" + current.path[1] + "/" + current.path[2] + "/" + current.path[3] + "/" + current.path[4] + "/" + slug + ".html"
|
||||
|
||||
li.c8
|
||||
!= partial("../../../../../_includes/_hover-card", {name: page.title, url: url })
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/test.html">angular2/test</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/test_lib/test_bed.js#L24">angular2/src/test_lib/test_bed.js (line 24)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/test_lib/test_bed.js#L19">angular2/src/test_lib/test_bed.js (line 19)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/view.html">angular2/view</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/dynamic_component_loader.js#L14">angular2/src/core/compiler/dynamic_component_loader.js (line 14)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/dynamic_component_loader.js#L11">angular2/src/core/compiler/dynamic_component_loader.js (line 11)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/view.html">angular2/view</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/dynamic_component_loader.js#L47">angular2/src/core/compiler/dynamic_component_loader.js (line 47)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/dynamic_component_loader.js#L44">angular2/src/core/compiler/dynamic_component_loader.js (line 44)</a>
|
||||
|
||||
:markdown
|
||||
Service for dynamically loading a Component into an arbitrary position in the internal Angular
|
||||
|
@ -15,7 +15,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(compiler:Compiler, directiveMetadataReader:DirectiveMetadataReader, viewFactory:ViewFactory, viewHydrator:AppViewHydrator)
|
||||
constructor(compiler:Compiler, viewManager: AppViewManager)
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -29,7 +29,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
loadIntoExistingLocation(type:Type, location:ElementRef, injector:Injector = null)
|
||||
loadIntoExistingLocation(typeOrBinding, location:ElementRef, injector:Injector = null)
|
||||
|
||||
:markdown
|
||||
Loads a component into the location given by the provided ElementRef. The loaded component
|
||||
|
@ -45,7 +45,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
loadIntoNewLocation(type:Type, parentComponentLocation:ElementRef, elementOrSelector:any, injector:Injector = null)
|
||||
loadIntoNewLocation(typeOrBinding, parentComponentLocation:ElementRef, elementOrSelector:any, injector:Injector = null)
|
||||
|
||||
:markdown
|
||||
Loads a component in the element specified by elementOrSelector. The loaded component receives
|
||||
|
@ -61,7 +61,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
loadNextToExistingLocation(type:Type, location:ElementRef, injector:Injector = null)
|
||||
loadNextToExistingLocation(typeOrBinding, location:ElementRef, injector:Injector = null)
|
||||
|
||||
:markdown
|
||||
Loads a component next to the provided ElementRef. The loaded component receives
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/view.html">angular2/view</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/element_injector.js#L27">angular2/src/core/compiler/element_injector.js (line 27)</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/element_injector.js#L28">angular2/src/core/compiler/element_injector.js (line 28)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
|
@ -13,7 +13,7 @@ p.location-badge.
|
|||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(elementInjector, hostView, boundElementIndex, injector)
|
||||
constructor(elementInjector, hostView, boundElementIndex, injector, viewManager, defaultProtoView)
|
||||
|
||||
:markdown
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ p.location-badge.
|
|||
```html
|
||||
<tabs>
|
||||
<pane title="Overview">...</pane>
|
||||
<pane *for="o in objects" [title]="o.title">{{o.text}}</pane>
|
||||
<pane *for="#o of objects" [title]="o.title">{{o.text}}</pane>
|
||||
</tabs>
|
||||
```
|
||||
|
||||
|
@ -35,7 +35,7 @@ p.location-badge.
|
|||
partialy since `*for` could rearange the list of `<pane>` components which would not be reported to `<tabs>`
|
||||
component and thus the list of `<pane>` componets would be out of sync with respect to the list of `<pane>` elements.
|
||||
|
||||
A prefferd solution is to inject a `QueryList` which is a live list of directives in the component`s light DOM.
|
||||
A preferred solution is to inject a `QueryList` which is a live list of directives in the component`s light DOM.
|
||||
|
||||
```javascript
|
||||
@Component({
|
||||
|
@ -44,7 +44,7 @@ p.location-badge.
|
|||
@View({
|
||||
template: `
|
||||
<ul>
|
||||
<li *for="pane of panes">{{pane.title}}</li>
|
||||
<li *for="#pane of panes">{{pane.title}}</li>
|
||||
</ul>
|
||||
<content></content>
|
||||
`
|
||||
|
|
|
@ -0,0 +1,139 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href="/angular2/view.html">angular2/view</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/compiler/view_container_ref.js#L11">angular2/src/core/compiler/view_container_ref.js (line 11)</a>
|
||||
|
||||
:markdown
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3 constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(viewManager: avmModule.AppViewManager, location: eiModule.ElementRef, defaultProtoView: viewModule.AppProtoView)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 clear
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
clear()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 create
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
create(atIndex:number=-1, protoView:viewModule.AppProtoView = null, injector:Injector = null)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 detach
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
detach(atIndex:number=-1)
|
||||
|
||||
:markdown
|
||||
The method can be used together with insert to implement a view move, i.e.
|
||||
moving the dom nodes while the directives in the view stay intact.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 get
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
get(index: number)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 indexOf
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
indexOf(view:viewModule.AppView)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 insert
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
insert(view:viewModule.AppView, atIndex:number=-1)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 length
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3 remove
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
remove(atIndex:number=-1)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -24,8 +24,8 @@
|
|||
"title" : "QueryList Class"
|
||||
},
|
||||
|
||||
"ViewContainer-class" : {
|
||||
"title" : "ViewContainer Class"
|
||||
"ViewContainerRef-class" : {
|
||||
"title" : "ViewContainerRef Class"
|
||||
},
|
||||
|
||||
"BaseQueryList-class" : {
|
||||
|
|
Loading…
Reference in New Issue