Moved all heroes functionality into milestone 2 Crisis Center initial functionality is milestone 3 Admin feature module as milestone 4 including route guard examples Updated milestone 5 to lazy load admin feature module Added examples for CanLoad, CanActivateChildren guard, component-less routes Added section on explanation of ActivatedRoute Added section on animating route components Added section on relative navigation
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
// #docplaster
 | 
						|
// #docregion
 | 
						|
// #docregion route-config
 | 
						|
import { ModuleWithProviders } from '@angular/core';
 | 
						|
import { Routes, RouterModule } from '@angular/router';
 | 
						|
 | 
						|
// #enddocregion route-config
 | 
						|
// #enddocregion
 | 
						|
 | 
						|
// #docregion base-routes
 | 
						|
import { HeroListComponent }     from './hero-list.component';
 | 
						|
import { CrisisCenterComponent } from './crisis-center/crisis-center.component';
 | 
						|
import { HeroDetailComponent }   from './heroes/hero-detail.component';
 | 
						|
import { PageNotFoundComponent } from './not-found.component';
 | 
						|
import { PageNotFoundComponent as HomeComponent } from './not-found.component';
 | 
						|
// #enddocregion base-routes
 | 
						|
 | 
						|
// #docregion
 | 
						|
// #docregion route-config
 | 
						|
const appRoutes: Routes = [
 | 
						|
  // #docregion route-defs
 | 
						|
  // #docregion hero-detail-route
 | 
						|
  { path: 'hero/:id', component: HeroDetailComponent },
 | 
						|
  // #enddocregion hero-detail-route
 | 
						|
  { path: 'crisis-center', component: CrisisCenterComponent },
 | 
						|
  {
 | 
						|
    path: 'heroes',
 | 
						|
    component: HeroListComponent,
 | 
						|
    data: {
 | 
						|
      title: 'Heroes List'
 | 
						|
    }
 | 
						|
  },
 | 
						|
  { path: '', component: HomeComponent },
 | 
						|
  // #enddocregion route-defs
 | 
						|
  { path: '**', component: PageNotFoundComponent }
 | 
						|
];
 | 
						|
 | 
						|
export const appRoutingProviders: any[] = [
 | 
						|
 | 
						|
];
 | 
						|
 | 
						|
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
 | 
						|
// #enddocregion route-config
 | 
						|
// #enddocregion
 |