8000 router api docs · rusongyu/angular.io@916d5a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 916d5a1

Browse files
committed
router api docs
1 parent cf7bc21 commit 916d5a1

33 files changed

+639
-77
lines changed

public/docs/js/latest/api/annotations/Attribute-class.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
p.location-badge.
33
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
4-
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>
4+
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>
55

66
:markdown
77
Specifies that a constant attribute value should be injected.

public/docs/js/latest/api/annotations/Component-class.jade

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
p.location-badge.
33
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
4-
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>
4+
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>
55

66
:markdown
77
Declare reusable UI building blocks for an application.
@@ -45,18 +45,20 @@ p.location-badge.
4545
pre.prettyprint
4646
code.
4747
constructor({
48-
selector,
49-
properties,
50-
events,
51-
hostListeners,
52-
injectables,
53-
lifecycle,
54-
changeDetection = DEFAULT
48+
selector,
49+
properties,
50+
events,
51+
hostListeners,
52+
hostProperties,
53+
injectables,
54+
lifecycle,
55+
changeDetection = DEFAULT
5556
}:{
5657
selector:string,
5758
properties:Object,
5859
events:List,
59-
hostListeners:Object,
60+
hostListeners:any,
61+
hostProper F438 ties:any,
6062
injectables:List,
6163
lifecycle:List,
6264
changeDetection:string

public/docs/js/latest/api/annotations/Decorator-class.jade

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
p.location-badge.
33
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
4-
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>
4+
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>
55

66
:markdown
77
Directive that attaches behavior to DOM elements.
@@ -74,13 +74,15 @@ p.location-badge.
7474
properties,
7575
events,
7676
hostListeners,
77+
hostProperties,
7778
lifecycle,
7879
compileChildren = true,
7980
}:{
8081
selector:string,
8182
properties:any,
8283
events:List,
8384
hostListeners:any,
85+
hostProperties:any,
8486
lifecycle:List,
8587
compileChildren:boolean
8688
}={})

public/docs/js/latest/api/annotations/Directive-class.jade

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ p.location-badge.
5353

5454
To inject element-specific special objects, declare the constructor parameter as:
5555
- `element: NgElement` to obtain a DOM element (DEPRECATED: replacement coming)
56-
- `viewContainer: ViewContainer` to control child template instantiation, for <a href='Viewport-class.html'><code>Viewport</code></a> directives only
56+
- `viewContainer: ViewContainerRef` to control child template instantiation, for <a href='Viewport-class.html'><code>Viewport</code></a> directives only
5757
- `bindingPropagation: BindingPropagation` to control change detection in a more granular way.
5858

5959
## Example
@@ -185,8 +185,8 @@ p.location-badge.
185185

186186

187187
A directive can also query for other child directives. Since parent directives are instantiated before child
188-
directives, a directive can't simply inject the list of child directives. Instead, the directive
189-
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
188+
directives, a directive can't simply inject the list of child directives. Instead, the directive
189+
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
190190
<a href='Viewport-class.html'><code>Viewport</code></a> directive such as a `for`, an `if`, or a `switch`.
191191

192192
```
@@ -197,7 +197,7 @@ p.location-badge.
197197
}
198198
```
199199

200-
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`
200+
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`
201201
5 would not be included, because it is not a direct child.
202202

203203
### Injecting a live collection of descendant directives
@@ -246,12 +246,14 @@ p.location-badge.
246246
properties,
247247
events,
248248
hostListeners,
249+
hostProperties,
249250
lifecycle
250251
}:{
251252
selector:string,
252253
properties:any,
253254
events:List,
254255
hostListeners: any,
256+
hostProperties: any,
255257
lifecycle:List
256258
}={})
257259

@@ -369,6 +371,34 @@ p.location-badge.
369371

370372

371373

374+
.l-sub-section
375+
h3 hostProperties
376+
377+
378+
:markdown
379+
Specifies which DOM properties a directives updates.
380+
381+
## Syntax
382+
383+
```
384+
@Decorator({
385+
selector: 'input',
386+
hostProperties: {
387+
'value': 'value'
388+
}
389+
})
390+
class InputDecorator {
391+
value:string;
392+
}
393+
394+
In this example every time the value property of the decorator changes, Angular will update the value property of
395+
the host element.
396+
```
397+
398+
399+
400+
401+
372402
.l-sub-section
373403
h3 lifecycle
374404

public/docs/js/latest/api/annotations/DynamicComponent-class.jade

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
p.location-badge.
33
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
4-
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>
4+
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>
55

66
:markdown
77
Directive used for dynamically loading components.
@@ -57,17 +57,19 @@ p.location-badge.
5757
pre.prettyprint
5858
code.
5959
constructor({
60-
selector,
61-
properties,
62-
events,
63-
hostListeners,
F438
64-
injectables,
65-
lifecycle
60+
selector,
61+
properties,
62+
events,
63+
hostListeners,
64+
hostProperties,
65+
injectables,
66+
lifecycle
6667
}:{
6768
selector:string,
68-
properties:Object,
69+
properties:any,
6970
events:List,
70-
hostListeners:Object,
71+
hostListeners:any,
72+
hostProperties:any,
7173
injectables:List,
7274
lifecycle:List
7375
}={})

public/docs/js/latest/api/annotations/Query-class.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
p.location-badge.
33
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
4-
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>
4+
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>
55

66
:markdown
77
Specifies that a <a href='../view/QueryList-class.html'><code>QueryList</code></a> should be injected.

public/docs/js/latest/api/annotations/View-class.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ p.location-badge.
108108
:markdown
109109
Specifies an inline template for an angular component.
110110

111-
NOTE: either `templateURL` or `template` should be used, but not both.
111+
NOTE: either `templateUrl` or `template` should be used, but not both.
112112

113113

114114

@@ -121,7 +121,7 @@ p.location-badge.
121121
:markdown
122122
Specifies a template URL for an angular component.
123123

124-
NOTE: either `templateURL` or `template` should be used, but not both.
124+
NOTE: either `templateUrl` or `template` should be used, but not both.
125125

126126

127127

public/docs/js/latest/api/annotations/Viewport-class.jade

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

22
p.location-badge.
33
exported from <a href="/angular2/annotations.html">angular2/annotations</a>
4-
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>
4+
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>
55

66
:markdown
77
Directive that controls the instantiation, destruction, and positioning of inline template elements.
88

9-
A viewport directive uses a <a href='../view/ViewContainer-class.html'><code>ViewContainer</code></a> to instantiate, insert, move, and destroy views at runtime.
10-
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
9+
A viewport directive uses a <a href='../view/ViewContainerRef-class.html'><code>ViewContainerRef</code></a> to instantiate, insert, move, and destroy views at runtime.
10+
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
1111
where these actions are performed.
1212

1313
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.
5252
}
5353
})
5454
export class Unless {
55-
viewContainer: ViewContainer;
55+
viewContainer: ViewContainerRef;
5656
prevCondition: boolean;
5757

58-
constructor(viewContainer: ViewContainer) {
58+
constructor(viewContainer: ViewContainerRef) {
5959
this.viewContainer = viewContainer;
6060
this.prevCondition = null;
6161
}
@@ -107,12 +107,15 @@ p.location-badge.
107107
properties,
108108
events,
109109
hostListeners,
110+
hostProperties,
110111
lifecycle
111112
}:{
112-
selector:string,
113-
properties:any,
114-
events:List,
115-
lifecycle:List
113+
selector:string,
114+
properties:any,
115+
hostListeners:any,
116+
hostProperties:any,
117+
events:List,
118+
lifecycle:List
116119
}={})
117120

118121
:markdown

public/docs/js/latest/api/annotations/_data.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
"title" : "onAllChangesDone Var"
3737
},
3838

39-
"PropertySetter-class" : {
40-
"title" : "PropertySetter Class"
41-
},
42-
4339
"Attribute-class" : {
4440
"title" : "Attribute Class"
4541
},

public/docs/js/latest/api/change_detection/ChangeDetection-class.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ p.location-badge.
2222

2323
# Example
2424
```javascript
25-
bootstrap(MyApp, [bind(ChangeDetection).toValue(dynamicChangeDetection)]);
25+
bootstrap(MyApp, [bind(ChangeDetection).toClass(DynamicChangeDetection)]);
2626
```
2727
.l-main-section
2828
h2 Members

public/docs/js/latest/api/change_detection/DynamicChangeDetection-class.jade

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11

22
p.location-badge.
33
exported from <a href="/angular2/change_detection.html">angular2/change_detection</a>
4-
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>
4+
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>
55

66
:markdown
7+
Implements change detection that does not require `eval()`.
8+
9+
This is slower than <a href='JitChangeDetection-class.html'><code>JitChangeDetection</code></a>.
710

811
.l-main-section
912
h2 Members

public/docs/js/latest/api/change_detection/JitChangeDetection-class.jade

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11

22
p.location-badge.
33
exported from <a href="/angular2/change_detection.html">angular2/change_detection</a>
4-
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>
4+
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>
55

66
:markdown
7+
Implements faster change detection, by generating source code.
8+
9+
This requires `eval()`. For change detection that does not require `eval()`, see <a href='DynamicChangeDetection-class.html'><code>DynamicChangeDetection</code></a>.
710

811
.l-main-section
912
h2 Members

public/docs/js/latest/api/core/_data.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"index" : {
3-
"title" : "Core"
3+
"title" : "Core",
4+
"intro" : "Define angular core API here."
45
},
56

67
"bootstrap-function" : {

public/docs/js/latest/api/di/Key-class.jade

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,33 @@ p.location-badge.
3030

3131

3232
.l-sub-section
33-
h3 get
33+
h3 displayName
3434

3535

36-
pre.prettyprint
37-
code.
38-
get(token)
39-
4036
:markdown
41-
Retrieves a `Key` for a token.
37+
4238

4339

4440

4541

4642

4743
.l-sub-section
48-
h3 id
44+
h3 get
4945

5046

47+
pre.prettyprint
48+
code.
49+
get(token)
50+
5151
:markdown
52-
52+
Retrieves a `Key` for a token.
5353

5454

5555

5656

5757

5858
.l-sub-section
59-
h3 metadata
59+
h3 id
6060

6161

6262
:markdown

public/docs/js/latest/api/directives/For-class.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ p.location-badge.
4141

4242
pre.prettyprint
4343
code.
44-
constructor(viewContainer:ViewContainer)
44+
constructor(viewContainer:ViewContainerRef)
4545

4646
:markdown
4747

public/docs/js/latest/api/directives/If-class.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ p.location-badge.
3232

3333
pre.prettyprint
3434
code.
35-
constructor(viewContainer: ViewContainer)
35+
constructor(viewContainer: ViewContainerRef)
3636

3737
:markdown
3838

public/docs/js/latest/api/directives/SwitchDefault-class.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ p.location-badge.
2222

2323
pre.prettyprint
2424
code.
25-
constructor(viewContainer: ViewContainer, sswitch: Switch)
25+
constructor(viewContainer: ViewContainerRef, sswitch: Switch)
2626

2727
:markdown
2828

0 commit comments

Comments
 (0)
0