router api docs

This commit is contained in:
Alex Wolfe 2015-04-28 06:22:25 -07:00
parent cf7bc21acd
commit 916d5a154f
33 changed files with 641 additions and 79 deletions

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/annotations.html">angular2/annotations</a> 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 :markdown
Specifies that a constant attribute value should be injected. Specifies that a constant attribute value should be injected.

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/annotations.html">angular2/annotations</a> 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 :markdown
Declare reusable UI building blocks for an application. Declare reusable UI building blocks for an application.
@ -45,18 +45,20 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
constructor({ constructor({
selector, selector,
properties, properties,
events, events,
hostListeners, hostListeners,
injectables, hostProperties,
lifecycle, injectables,
changeDetection = DEFAULT lifecycle,
changeDetection = DEFAULT
}:{ }:{
selector:string, selector:string,
properties:Object, properties:Object,
events:List, events:List,
hostListeners:Object, hostListeners:any,
hostProperties:any,
injectables:List, injectables:List,
lifecycle:List, lifecycle:List,
changeDetection:string changeDetection:string

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/annotations.html">angular2/annotations</a> 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 :markdown
Directive that attaches behavior to DOM elements. Directive that attaches behavior to DOM elements.
@ -74,6 +74,7 @@ p.location-badge.
properties, properties,
events, events,
hostListeners, hostListeners,
hostProperties,
lifecycle, lifecycle,
compileChildren = true, compileChildren = true,
}:{ }:{
@ -81,6 +82,7 @@ p.location-badge.
properties:any, properties:any,
events:List, events:List,
hostListeners:any, hostListeners:any,
hostProperties:any,
lifecycle:List, lifecycle:List,
compileChildren:boolean compileChildren:boolean
}={}) }={})

View File

@ -53,7 +53,7 @@ p.location-badge.
To inject element-specific special objects, declare the constructor parameter as: To inject element-specific special objects, declare the constructor parameter as:
- `element: NgElement` to obtain a DOM element (DEPRECATED: replacement coming) - `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. - `bindingPropagation: BindingPropagation` to control change detection in a more granular way.
## Example ## Example
@ -246,12 +246,14 @@ p.location-badge.
properties, properties,
events, events,
hostListeners, hostListeners,
hostProperties,
lifecycle lifecycle
}:{ }:{
selector:string, selector:string,
properties:any, properties:any,
events:List, events:List,
hostListeners: any, hostListeners: any,
hostProperties: any,
lifecycle:List 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 .l-sub-section
h3 lifecycle h3 lifecycle

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/annotations.html">angular2/annotations</a> 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 :markdown
Directive used for dynamically loading components. Directive used for dynamically loading components.
@ -57,17 +57,19 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
constructor({ constructor({
selector, selector,
properties, properties,
events, events,
hostListeners, hostListeners,
injectables, hostProperties,
lifecycle injectables,
lifecycle
}:{ }:{
selector:string, selector:string,
properties:Object, properties:any,
events:List, events:List,
hostListeners:Object, hostListeners:any,
hostProperties:any,
injectables:List, injectables:List,
lifecycle:List lifecycle:List
}={}) }={})

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/annotations.html">angular2/annotations</a> 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 :markdown
Specifies that a <a href='../view/QueryList-class.html'><code>QueryList</code></a> should be injected. Specifies that a <a href='../view/QueryList-class.html'><code>QueryList</code></a> should be injected.

View File

@ -108,7 +108,7 @@ p.location-badge.
:markdown :markdown
Specifies an inline template for an angular component. 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 :markdown
Specifies a template URL for an angular component. 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.

View File

@ -1,13 +1,13 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/annotations.html">angular2/annotations</a> 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 :markdown
Directive that controls the instantiation, destruction, and positioning of inline template elements. 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. 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/ViewContainer-class.html'><code>ViewContainer</code></a> is created as a result of `<template>` element, and represents a location in the current view 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. 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 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 { export class Unless {
viewContainer: ViewContainer; viewContainer: ViewContainerRef;
prevCondition: boolean; prevCondition: boolean;
constructor(viewContainer: ViewContainer) { constructor(viewContainer: ViewContainerRef) {
this.viewContainer = viewContainer; this.viewContainer = viewContainer;
this.prevCondition = null; this.prevCondition = null;
} }
@ -107,12 +107,15 @@ p.location-badge.
properties, properties,
events, events,
hostListeners, hostListeners,
hostProperties,
lifecycle lifecycle
}:{ }:{
selector:string, selector:string,
properties:any, properties:any,
events:List, hostListeners:any,
lifecycle:List hostProperties:any,
events:List,
lifecycle:List
}={}) }={})
:markdown :markdown

View File

@ -36,10 +36,6 @@
"title" : "onAllChangesDone Var" "title" : "onAllChangesDone Var"
}, },
"PropertySetter-class" : {
"title" : "PropertySetter Class"
},
"Attribute-class" : { "Attribute-class" : {
"title" : "Attribute Class" "title" : "Attribute Class"
}, },

View File

@ -22,7 +22,7 @@ p.location-badge.
# Example # Example
```javascript ```javascript
bootstrap(MyApp, [bind(ChangeDetection).toValue(dynamicChangeDetection)]); bootstrap(MyApp, [bind(ChangeDetection).toClass(DynamicChangeDetection)]);
``` ```
.l-main-section .l-main-section
h2 Members h2 Members

View File

@ -1,9 +1,12 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/change_detection.html">angular2/change_detection</a> 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 :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 .l-main-section
h2 Members h2 Members

View File

@ -1,9 +1,12 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/change_detection.html">angular2/change_detection</a> 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 :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 .l-main-section
h2 Members h2 Members

View File

@ -1,6 +1,7 @@
{ {
"index" : { "index" : {
"title" : "Core" "title" : "Core",
"intro" : "Define angular core API here."
}, },
"bootstrap-function" : { "bootstrap-function" : {

View File

@ -29,6 +29,17 @@ p.location-badge.
.l-sub-section
h3 displayName
:markdown
.l-sub-section .l-sub-section
h3 get h3 get
@ -55,17 +66,6 @@ p.location-badge.
.l-sub-section
h3 metadata
:markdown
.l-sub-section .l-sub-section
h3 numberOfKeys h3 numberOfKeys

View File

@ -41,7 +41,7 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
constructor(viewContainer:ViewContainer) constructor(viewContainer:ViewContainerRef)
:markdown :markdown

View File

@ -32,7 +32,7 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
constructor(viewContainer: ViewContainer) constructor(viewContainer: ViewContainerRef)
:markdown :markdown

View File

@ -22,7 +22,7 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
constructor(viewContainer: ViewContainer, sswitch: Switch) constructor(viewContainer: ViewContainerRef, sswitch: Switch)
:markdown :markdown

View File

@ -26,7 +26,7 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
constructor(viewContainer: ViewContainer, sswitch: Switch) constructor(viewContainer: ViewContainerRef, sswitch: Switch)
:markdown :markdown

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/forms.html">angular2/forms</a> 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 :markdown
The accessor for writing a value and listening to changes on a checkbox input element. The accessor for writing a value and listening to changes on a checkbox input element.
@ -20,7 +20,7 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
constructor(cd:ControlDirective, setCheckedProperty:Function) constructor(cd:ControlDirective, elementRef:ElementRef, renderer:Renderer)
:markdown :markdown
@ -28,6 +28,17 @@ p.location-badge.
.l-sub-section
h3 checked
:markdown
.l-sub-section .l-sub-section
h3 onChange h3 onChange

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/forms.html">angular2/forms</a> 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 :markdown
Binds a control to a DOM element. Binds a control to a DOM element.

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/forms.html">angular2/forms</a> 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 :markdown
Binds a control group to a DOM element. Binds a control group to a DOM element.

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/forms.html">angular2/forms</a> 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 :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. 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 pre.prettyprint
code. code.
constructor(setValueProperty:Function) constructor()
:markdown :markdown
@ -40,6 +40,17 @@ p.location-badge.
.l-sub-section
h3 value
:markdown
.l-sub-section .l-sub-section
h3 writeValue h3 writeValue

View File

@ -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 = &#39;/&#39;)
:markdown
.l-sub-section
h3 activateOutlets
pre.prettyprint
code.
activateOutlets(instruction:Instruction)
:markdown
.l-sub-section
h3 childRouter
pre.prettyprint
code.
childRouter(outletName = &#39;default&#39;)
: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 = &#39;default&#39;)
: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

View File

@ -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

View File

@ -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"
}
}

View File

@ -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 })

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/test.html">angular2/test</a> 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 :markdown

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/view.html">angular2/view</a> 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 :markdown

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/view.html">angular2/view</a> 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 :markdown
Service for dynamically loading a Component into an arbitrary position in the internal Angular Service for dynamically loading a Component into an arbitrary position in the internal Angular
@ -15,7 +15,7 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
constructor(compiler:Compiler, directiveMetadataReader:DirectiveMetadataReader, viewFactory:ViewFactory, viewHydrator:AppViewHydrator) constructor(compiler:Compiler, viewManager: AppViewManager)
:markdown :markdown
@ -29,7 +29,7 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
loadIntoExistingLocation(type:Type, location:ElementRef, injector:Injector = null) loadIntoExistingLocation(typeOrBinding, location:ElementRef, injector:Injector = null)
:markdown :markdown
Loads a component into the location given by the provided ElementRef. The loaded component Loads a component into the location given by the provided ElementRef. The loaded component
@ -45,7 +45,7 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
loadIntoNewLocation(type:Type, parentComponentLocation:ElementRef, elementOrSelector:any, injector:Injector = null) loadIntoNewLocation(typeOrBinding, parentComponentLocation:ElementRef, elementOrSelector:any, injector:Injector = null)
:markdown :markdown
Loads a component in the element specified by elementOrSelector. The loaded component receives Loads a component in the element specified by elementOrSelector. The loaded component receives
@ -61,7 +61,7 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
loadNextToExistingLocation(type:Type, location:ElementRef, injector:Injector = null) loadNextToExistingLocation(typeOrBinding, location:ElementRef, injector:Injector = null)
:markdown :markdown
Loads a component next to the provided ElementRef. The loaded component receives Loads a component next to the provided ElementRef. The loaded component receives

View File

@ -1,7 +1,7 @@
p.location-badge. p.location-badge.
exported from <a href="/angular2/view.html">angular2/view</a> 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 :markdown
@ -13,7 +13,7 @@ p.location-badge.
pre.prettyprint pre.prettyprint
code. code.
constructor(elementInjector, hostView, boundElementIndex, injector) constructor(elementInjector, hostView, boundElementIndex, injector, viewManager, defaultProtoView)
:markdown :markdown

View File

@ -23,7 +23,7 @@ p.location-badge.
```html ```html
<tabs> <tabs>
<pane title="Overview">...</pane> <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> </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>` 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. 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 ```javascript
@Component({ @Component({
@ -44,7 +44,7 @@ p.location-badge.
@View({ @View({
template: ` template: `
<ul> <ul>
<li *for="pane of panes">{{pane.title}}</li> <li *for="#pane of panes">{{pane.title}}</li>
</ul> </ul>
<content></content> <content></content>
` `

View File

@ -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

View File

@ -24,8 +24,8 @@
"title" : "QueryList Class" "title" : "QueryList Class"
}, },
"ViewContainer-class" : { "ViewContainerRef-class" : {
"title" : "ViewContainer Class" "title" : "ViewContainerRef Class"
}, },
"BaseQueryList-class" : { "BaseQueryList-class" : {