import { NgModule } from
'@angular/core'
;
import { RouterModule, Routes,
PreloadAllModules } from
'@angular/router'
;
import { ListComponent } from
'./list/list.component'
;
import { DetailComponent } from
'./detail/detail.component'
;
import { AppComponent } from
'./app.component'
;
import { PageComponent } from
'./page/page.component'
;
import { NewComponent } from
'./new/new.component'
;
const appRoutes: Routes = [
{ path:
''
, redirectTo:
'/contact'
,
pathMatch:
'full'
},
{ path:
'contact'
, component: ListComponent },
{ path:
'details/:id'
, component: DetailComponent },
{ path:
'new'
, component: NewComponent },
{ path:
'not-found'
, component: PageComponent },
{ path:
'**'
, redirectTo:
'/not-found'
}
]
@NgModule({
imports: [RouterModule.forRoot(appRoutes,
{
preloadingStrategy: PreloadAllModules
})],
exports: [RouterModule]
})
export class AppRoutingModule {
}