Simplified routing in tutorial example Updated ngmodule guide and ngmodule faq with routing module prose
		
			
				
	
	
		
			21 lines
		
	
	
		
			505 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			505 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| // #docplaster
 | |
| // #docregion
 | |
| import { NgModule }     from '@angular/core';
 | |
| import { RouterModule } from '@angular/router';
 | |
| 
 | |
| import { CrisisListComponent }  from './crisis-list.component';
 | |
| import { HeroListComponent }    from './hero-list.component';
 | |
| 
 | |
| @NgModule({
 | |
|   imports: [
 | |
|     RouterModule.forRoot([
 | |
|       { path: 'crisis-center', component: CrisisListComponent },
 | |
|       { path: 'heroes', component: HeroListComponent }
 | |
|     ])
 | |
|   ],
 | |
|   exports: [
 | |
|     RouterModule
 | |
|   ]
 | |
| })
 | |
| export class AppRoutingModule {}
 |