| import { NgModule } from '@angular/core'; | = | import { NgModule } from '@angular/core'; |
| import { Routes, RouterModule } from '@angular/router'; | import { Routes, RouterModule } from '@angular/router'; | |
| -+ | import { NotFoundComponent } from './not-found/not-found.component'; | |
| = | ||
| // ******************************************************************************* | // ******************************************************************************* | |
| // Layouts | // Layouts | |
| import { Layout1Component } from './layout/layout-1/layout-1.component'; | import { Layout1Component } from './layout/layout-1/layout-1.component'; | |
| // ******************************************************************************* | // ******************************************************************************* | |
| // Pages | // Pages | |
| import { HomeComponent } from './home/home.component'; | import { HomeComponent } from './home/home.component'; | |
| import { Page2Component } from './page-2/page-2.component'; | import { Page2Component } from './page-2/page-2.component'; | |
| // ******************************************************************************* | // ******************************************************************************* | |
| // Routes | // Routes | |
| const routes: Routes = [ | const routes: Routes = [ | |
| { path: '', component: Layout1Component, pathMatch: 'full', children: [ | { path: '', component: Layout1Component, pathMatch: 'full', children: [ | |
| { path: '', component: HomeComponent }, | { path: '', component: HomeComponent }, | |
| ]}, | ]}, | |
| { path: 'page-2', component: Layout1Component, children: [ | { path: 'page-2', component: Layout1Component, children: [ | |
| { path: '', component: Page2Component }, | { path: '', component: Page2Component }, | |
| ]} | <> | ]}, |
| // 404 Not Found page | ||
| { path: '**', component: NotFoundComponent } | ||
| = | ||
| ]; | ]; | |
| // ******************************************************************************* | // ******************************************************************************* | |
| // | // | |
| @NgModule({ | @NgModule({ | |
| imports: [RouterModule.forRoot(routes)], | imports: [RouterModule.forRoot(routes)], | |
| exports: [RouterModule] | exports: [RouterModule] | |
| }) | }) | |
| export class AppRoutingModule {} | export class AppRoutingModule {} |