| 
									
										
										
										
											2016-03-16 18:01:33 +02:00
										 |  |  | // #docplaster
 | 
					
						
							|  |  |  | // #docregion
 | 
					
						
							| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  | import { Component, OnInit } from '@angular/core'; | 
					
						
							|  |  |  | // #enddocregion
 | 
					
						
							|  |  |  | import { NgModule } from '@angular/core'; | 
					
						
							|  |  |  | import { BrowserModule } from '@angular/platform-browser'; | 
					
						
							| 
									
										
										
										
											2016-03-16 18:01:33 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | @Component({ | 
					
						
							|  |  |  |   selector: 'hero-lifecycle', | 
					
						
							|  |  |  |   template: `<h1>Hero: {{name}}</h1>` | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | // #docregion
 | 
					
						
							| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  | class HeroComponent | 
					
						
							| 
									
										
										
										
											2016-03-16 18:01:33 +02:00
										 |  |  |     implements OnInit { | 
					
						
							| 
									
										
										
										
											2016-06-08 01:06:25 +02:00
										 |  |  |   name: string; | 
					
						
							| 
									
										
										
										
											2016-03-16 18:01:33 +02:00
										 |  |  |   ngOnInit() { | 
					
						
							|  |  |  |     this.name = 'Windstorm'; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | // #enddocregion
 | 
					
						
							| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | @NgModule({ | 
					
						
							|  |  |  |   imports: [ BrowserModule ], | 
					
						
							|  |  |  |   declarations: [ HeroComponent ], | 
					
						
							|  |  |  |   bootstrap: [ HeroComponent ] | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | export class HeroesLifecycleModule { } | 
					
						
							|  |  |  | 
 |