This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree 20 files changed +251
-168
lines changed
20 files changed +251
-168
lines changed Original file line number Diff line number Diff line change 1
1
( function ( app ) {
2
2
3
- // #docregion
3
+ // #docregion parameters
4
4
function HeroComponent ( name ) {
5
5
this . name = name ;
6
6
}
13
13
template : '<h1>Hero: {{name}}</h1>'
14
14
} )
15
15
] ;
16
- // #enddocregion
16
+ // #enddocregion parameters
17
+
17
18
app . HeroDIInjectComponent = HeroComponent ;
19
+
20
+ } ) ( window . app = window . app || { } ) ;
21
+
22
+ ( function ( app ) {
23
+ // #docregion ctor
24
+ var HeroComponent = ng . core . Component ( {
25
+ selector : 'hero-di-inline2' ,
26
+ template : '<h1>Hero: {{name}}</h1>'
27
+ } )
28
+ . Class ( {
29
+ constructor :
30
+ [ new ng . core . Inject ( 'heroName' ) ,
31
+ function ( name ) {
32
+ this . name = name ;
33
+ } ]
34
+ } ) ;
35
+ // #enddocregion ctor
36
+
37
+ app . HeroDIInjectComponent2 = HeroComponent ;
18
38
19
39
} ) ( window . app = window . app || { } ) ;
Original file line number Diff line number Diff line change 6
6
} )
7
7
. Class ( {
8
8
constructor :
9
- [ app . DataService , function ( service ) {
10
- this . name = service . getHeroName ( ) ;
11
- } ]
9
+ [ app . DataService ,
10
+ function ( service ) {
11
+ this . name = service . getHeroName ( ) ;
12
+ } ]
12
13
} ) ;
13
14
// #enddocregion
14
15
app . HeroDIInlineComponent = HeroComponent ;
Original file line number Diff line number Diff line change 1
1
( function ( app ) {
2
2
3
3
// #docregion
4
+ app . HeroDIComponent = HeroComponent ;
5
+
4
6
function HeroComponent ( dataService ) {
5
7
this . name = dataService . getHeroName ( ) ;
6
8
}
14
16
} )
15
17
] ;
16
18
// #enddocregion
17
- app . HeroDIComponent = HeroComponent ;
18
19
19
20
} ) ( window . app = window . app || { } ) ;
Original file line number Diff line number Diff line change
1
+ // #docplaster
2
+ // #docregion appexport
1
3
( function ( app ) {
2
4
3
5
// #docregion component
Original file line number Diff line number Diff line change
1
+ // #docplaster
1
2
( function ( app ) {
2
3
// #docregion
3
- function HeroComponent ( ) {
4
- }
4
+ function HeroComponent ( ) { }
5
5
// #enddocregion
6
6
HeroComponent . annotations = [
7
7
new ng . core . Component ( {
Original file line number Diff line number Diff line change
1
+ // #docplaster
1
2
// #docregion appexport
2
3
( function ( app ) {
3
4
// #enddocregion appexport
6
7
// #docregion appexport
7
8
// #docregion constructorproto
8
9
function HeroComponent ( ) {
10
+ this . title = "Hero Detail" ;
9
11
}
12
+
10
13
// #enddocregion constructorproto
11
14
// #enddocregion appexport
12
15
HeroComponent . annotations = [
18
21
] ;
19
22
// #docregion constructorproto
20
23
HeroComponent . prototype . getName =
21
- function ( ) {
22
- return 'Windstorm' ;
23
- } ;
24
+ function ( ) { return 'Windstorm' ; } ;
24
25
// #enddocregion constructorproto
25
26
// #enddocregion metadata
26
27
Original file line number Diff line number Diff line change
1
+ // #docplaster
1
2
// #docregion appimport
2
3
( function ( app ) {
3
4
// #enddocregion appimport
26
27
bootstrap ( app . HeroDIInjectComponent , [
27
28
ng . core . provide ( 'heroName' , { useValue : 'Windstorm' } )
28
29
] ) ;
30
+ bootstrap ( app . HeroDIInjectComponent2 , [
31
+ ng . core . provide ( 'heroName' , { useValue : 'Bombasto' } )
32
+ ] ) ;
29
33
bootstrap ( app . HeroDIInjectAdditionalComponent ) ;
30
34
bootstrap ( app . HeroIOComponent ) ;
31
35
bootstrap ( app . HeroesHostBindingsComponent ) ;
Original file line number Diff line number Diff line change 33
33
< hero-lifecycle > Loading app...</ hero-lifecycle >
34
34
< hero-di > Loading app...</ hero-di >
35
35
< hero-di-inline > Loading app...</ hero-di-inline >
36
+ < hero-di-inline2 > Loading app...</ hero-di-inline2 >
36
37
< hero-di-inject > Loading app...</ hero-di-inject >
37
38
< hero-di-inject-additional > Loading app...</ hero-di-inject-additional >
38
39
< hero-io > Loading app...</ hero-io >
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ export class ConfirmComponent {
26
26
onNotOkClick ( ) {
27
27
this . notOk . next ( true ) ;
28
28
}
29
-
30
29
}
31
30
// #enddocregion
32
31
Original file line number Diff line number Diff line change
1
+ // #docplaster
1
2
// #docregion
2
3
import { Component , OnInit }
3
4
from 'angular2/core' ;
Original file line number Diff line number Diff line change
1
+ // #docplaster
1
2
// #docregion metadata
2
3
import { Component } from 'angular2/core' ;
3
4
4
5
@Component ( {
5
6
selector : 'hero-view' ,
6
- template : `
7
- <h1>Hero: {{getName()}}</h1>
8
- `
7
+ template :
8
+ '<h1>Hero: {{getName()}}</h1>'
9
9
} )
10
10
// #docregion appexport
11
11
// #docregion class
12
12
export class HeroComponent {
13
- getName ( ) {
14
- return 'Windstorm' ;
15
- }
13
+ title = 'Hero Detail' ;
14
+ getName ( ) { return 'Windstorm' ; }
16
15
}
17
16
// #enddocregion class
18
17
// #enddocregion appexport
Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ export class HeroesComponent {
13
13
hClass = true
14
14
active :boolean ;
15
15
16
- constructor ( ) {
17
- }
16
+ constructor ( ) { }
18
17
19
18
@HostListener ( 'click' )
20
19
clicked ( ) {
Original file line number Diff line number Diff line change 2
2
"index" : {
3
3
"title" : " Cookbook" ,
4
4
"navTitle" : " Overview" ,
5
- "description " : " A collection of recipes for common Angular application scenarios"
5
+ "intro " : " A collection of recipes for common Angular application scenarios"
6
6
},
7
7
8
8
"a1-a2-quick-reference" : {
9
9
"title" : " Angular 1 to 2 Quick Reference" ,
10
10
"navTitle" : " Angular 1 to 2 Quick Ref" ,
11
- "description " : " Learn how Angular 1 concepts and techniques map to Angular 2" ,
11
+ "intro " : " Learn how Angular 1 concepts and techniques map to Angular 2" ,
12
12
"hide" : true
13
13
},
14
14
15
15
"component-communication" : {
16
16
"title" : " Component Interaction" ,
17
- "description" : " Share information between different directives and components"
17
+ "intro" : " Share information between different directives and components"
18
+ },
19
+
20
+ "dynamic-form" : {
21
+ "title" : " Dynamic Form" ,
22
+ "intro" : " Render dynamic forms with NgFormModel" ,
23
+ "hide" : true
24
+ },
25
+
26
+ "ts-to-js" : {
27
+ "title" : " TypeScript to JavaScript" ,
28
+ "intro" : " Convert Angular 2 TypeScript examples into ES5 JavaScript" ,
29
+ "hide" : true
18
30
}
19
31
}
Original file line number Diff line number Diff line change
1
+ != partial (" ../../../_includes/_ts-temp" )
Original file line number Diff line number Diff line change
1
+ != partial (" ../../../_includes/_ts-temp" )
Original file line number Diff line number Diff line change 2
2
"index" : {
3
3
"title" : " Cookbook" ,
4
4
"navTitle" : " Overview" ,
5
- "description " : " A collection of recipes for common Angular application scenarios"
5
+ "intro " : " A collection of recipes for common Angular application scenarios"
6
6
},
7
7
8
8
"a1-a2-quick-reference" : {
9
9
"title" : " Angular 1 to 2 Quick Reference" ,
10
10
"navTitle" : " Angular 1 to 2 Quick Ref" ,
11
- "description " : " Learn how Angular 1 concepts and techniques map to Angular 2"
11
+ "intro " : " Learn how Angular 1 concepts and techniques map to Angular 2"
12
12
},
13
13
14
14
"component-communication" : {
15
15
"title" : " Component Interaction" ,
16
- "description" : " Share information between different directives and components"
16
+ "intro" : " Share information between different directives and components"
17
+ },
18
+
19
+ "dynamic-form" : {
20
+ "title" : " Dynamic Form" ,
21
+ "intro" : " Render dynamic forms with NgFormModel" ,
22
+ "hide" : true
17
23
},
18
24
19
25
"ts-to-js" : {
20
26
"title" : " TypeScript to JavaScript" ,
21
- "intro" : " Angular 2 TypeScript examples can be easily converted into ES5 JavaScript"
27
+ "intro" : " Convert Angular 2 TypeScript examples into ES5 JavaScript"
22
28
}
23
29
24
30
}
Original file line number Diff line number Diff line change
1
+ != partial (" ../../../_includes/_ts-temp" )
You can’t perform that action at this time.
0 commit comments