This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +188
-201
lines changed Expand file tree Collapse file tree 9 files changed +188
-201
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ import { BrowserModule } from '@angular/platform-browser';
10
10
template : `<h1>Hero: {{name}}</h1>`
11
11
} )
12
12
// #docregion
13
- class HeroComponent
14
- implements OnInit {
13
+ class HeroComponent {
15
14
name ;
16
15
ngOnInit ( ) {
17
16
this . name = 'Windstorm' ;
Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ class HeroComponent {
11
11
this . name = 'Windstorm' ;
12
12
}
13
13
}
14
+ // #enddocregion
14
15
15
16
HeroComponent . annotations = [
16
17
new Component ( {
17
18
selector : 'hero-lifecycle' ,
18
19
template : `<h1>Hero: {{name}}</h1>`
19
20
} )
20
21
] ;
21
- // #enddocregion
22
22
23
23
export class HeroesLifecycleModule { }
24
24
Original file line number Diff line number Diff line change 2
2
// #docregion metadata
3
3
import { Component } from '@angular/core' ;
4
4
5
- // #docregion appexport
6
5
// #docregion class
6
+ // #docregion appexport
7
7
export class HeroComponent {
8
8
construct ( ) {
9
9
this . title = 'Hero Detail' ;
10
10
}
11
11
getName ( ) { return 'Windstorm' ; }
12
12
}
13
+ // #enddocregion appexport
14
+ // #enddocregion class
13
15
14
16
HeroComponent . annotations = [
15
17
new Component ( {
16
18
selector : 'hero-view' ,
17
19
template : '<h1>Hero: {{getName()}}</h1>'
18
20
} )
19
21
] ;
20
- // #enddocregion class
21
- // #enddocregion appexport
22
22
// #enddocregion metadata
23
23
24
24
import { NgModule } from '@angular/core' ;
Original file line number Diff line number Diff line change 5
5
// #docregion component
6
6
var HeroComponent = ng . core . Component ( {
7
7
selector : 'hero-view-2' ,
8
- template :
9
- '<h1>Name: {{getName()}}</h1>' ,
8
+ template : '<h1>Name: {{getName()}}</h1>' ,
10
9
} )
11
10
. Class ( {
12
11
constructor : function ( ) {
Original file line number Diff line number Diff line change 10
10
} )
11
11
] ;
12
12
// #docregion
13
- HeroComponent . prototype . ngOnInit =
14
- function ( ) {
15
- this . name = 'Windstorm' ;
16
- } ;
13
+ HeroComponent . prototype . ngOnInit = function ( ) {
14
+ this . name = 'Windstorm' ;
15
+ } ;
17
16
// #enddocregion
18
17
19
18
app . HeroesLifecycleModule =
Original file line number Diff line number Diff line change 15
15
HeroComponent . annotations = [
16
16
new ng . core . Component ( {
17
17
selector : 'hero-view' ,
18
- template :
19
- '<h1>Hero: {{getName()}}</h1>'
18
+ template : '<h1>Hero: {{getName()}}</h1>'
20
19
} )
21
20
] ;
22
21
// #docregion constructorproto
23
- HeroComponent . prototype . getName =
24
- function ( ) { return 'Windstorm' ; } ;
22
+
23
+ HeroComponent . prototype . getName = function ( ) { return 'Windstorm' ; } ;
25
24
// #enddocregion constructorproto
26
25
// #enddocregion metadata
27
26
Original file line number Diff line number Diff line change 4
4
// #enddocregion appimport
5
5
6
6
// #docregion ng2import
7
- var platformBrowserDynamic =
8
- ng . platformBrowserDynamic . platformBrowserDynamic ;
9
- var LocationStrategy =
10
- ng . common . LocationStrategy ;
11
- var HashLocationStrategy =
12
- ng . common . HashLocationStrategy ;
7
+ var platformBrowserDynamic = ng . platformBrowserDynamic . platformBrowserDynamic ;
8
+ var LocationStrategy = ng . common . LocationStrategy ;
9
+ var HashLocationStrategy = ng . common . HashLocationStrategy ;
13
10
// #enddocregion ng2import
14
11
15
12
// #docregion appimport
Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ import { BrowserModule } from '@angular/platform-browser';
10
10
template : `<h1>Hero: {{name}}</h1>`
11
11
} )
12
12
// #docregion
13
- class HeroComponent
14
- implements OnInit {
13
+ class HeroComponent implements OnInit {
15
14
name : string ;
16
15
ngOnInit ( ) {
17
16
this . name = 'Windstorm' ;
You can’t perform that action at this time.
0 commit comments