31 lines
		
	
	
		
			623 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			623 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| // #docregion
 | |
| import { provideRouter, RouterConfig }  from '@angular/router';
 | |
| 
 | |
| import { DashboardComponent } from './dashboard.component';
 | |
| import { HeroesComponent } from './heroes.component';
 | |
| import { HeroDetailComponent } from './hero-detail.component';
 | |
| 
 | |
| const routes: RouterConfig = [
 | |
|   {
 | |
|     path: '',
 | |
|     redirectTo: '/dashboard',
 | |
|     pathMatch: 'full'
 | |
|   },
 | |
|   {
 | |
|     path: 'dashboard',
 | |
|     component: DashboardComponent
 | |
|   },
 | |
|   {
 | |
|     path: 'detail/:id',
 | |
|     component: HeroDetailComponent
 | |
|   },
 | |
|   {
 | |
|     path: 'heroes',
 | |
|     component: HeroesComponent
 | |
|   }
 | |
| ];
 | |
| 
 | |
| export const appRouterProviders = [
 | |
|   provideRouter(routes)
 | |
| ];
 |