20 lines
		
	
	
		
			581 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			581 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { ModuleWithProviders } from '@angular/core';
 | |
| import { Routes,
 | |
|          RouterModule } from '@angular/router';
 | |
| 
 | |
| import { HeroComponent }       from './hero.component';
 | |
| import { HeroListComponent }   from './hero-list.component';
 | |
| import { HeroDetailComponent } from './hero-detail.component';
 | |
| 
 | |
| const routes: Routes = [
 | |
|   { path: '',
 | |
|     component: HeroComponent,
 | |
|     children: [
 | |
|       { path: '',    component: HeroListComponent },
 | |
|       { path: ':id', component: HeroDetailComponent }
 | |
|     ]
 | |
|   }
 | |
| ];
 | |
| 
 | |
| export const routing: ModuleWithProviders = RouterModule.forChild(routes);
 |