@@ -66,10 +66,13 @@ import {
6666} from '@angularclass/hmr' ;
6767< % _ if ( filters . uirouter ) { - % >
6868import { UIRouterModule } from 'ui-router-ng2' ; < % } % >
69+ < % _ if ( filters . ngroute ) { - % >
70+ import { RouterModule, Routes } from '@angular/router' ; < % } % >
6971import { provideAuth } from 'angular2-jwt';
7072
7173import { AppComponent } from './app.component';
7274import { MainModule } from './main/main.module';
75+ // import { MainComponent } from './main/main.component';
7376import { DirectivesModule } from '../components/directives.module';
7477import { AccountModule } from './account/account.module';
7578import { AdminModule } from './admin/admin.module';
@@ -95,12 +98,30 @@ if(constants.env === 'development') {
9598 providers . push ( { provide : RequestOptions , useClass : HttpOptions } ) ;
9699}
97100
101+ const appRoutes: Routes = [
102+ //{ path : 'crisis-center' , component : CrisisListComponent } ,
103+ //{ path : 'hero/:id' , component : HeroDetailComponent } ,
104+ // {
105+ // path: 'home',
106+ // component: MainComponent,
107+ // data: { title: 'Home' }
108+ // },
109+ { path : '' ,
110+ redirectTo : '/home' ,
111+ pathMatch : 'full'
112+ } ,
113+ //{ path: '**', component: PageNotFoundComponent }
114+ ] ;
115+
98116@NgModule ( {
99117 providers,
100118 imports : [
101119 BrowserModule ,
102120 HttpModule ,
103- UIRouterModule . forRoot ( ) ,
121+ < % _ if ( filters . uirouter ) { - % >
122+ UIRouterModule . forRoot ( ) , < % } % >
123+ < % _ if ( filters . ngroute ) { - % >
124+ RouterModule . forRoot ( appRoutes , { enableTracing : process . env . NODE_ENV === 'development' } ) , < % } % >
104125 MainModule,
105126 DirectivesModule,
106127 AccountModule,
0 commit comments