Guest User

Untitled

a guest
Oct 17th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. import { Routes } from '@angular/router';
  2. import { HomeComponent } from './home/home.component';
  3. import { RestaurantsComponent } from './restaurants/restaurants.component';
  4. import { RestaurantDetailComponent } from './restaurant-detail/restaurant-detail.component';
  5. import { MenuComponent } from './restaurant-detail/menu/menu.component';
  6. import { ReviewsComponent } from './restaurant-detail/reviews/reviews.component';
  7. import { OrderSumaryComponent } from './order-sumary/order-sumary.component';
  8. import { NotFoundComponent } from './not-found/not-found.component';
  9. import { LoginComponent } from './security/login/login.component';
  10. import { LoggedInGuard } from './security/loggedin.guard';
  11.  
  12. export const ROUTES: Routes = [
  13. {path: '', component: HomeComponent},
  14. {path: 'login/:to', component: LoginComponent},
  15. {path: 'login', component: LoginComponent},
  16. {
  17. path: 'restaurants/:id', component: RestaurantDetailComponent,
  18. children: [
  19. {path: '', redirectTo: 'menu', pathMatch: 'full'},
  20. {path: 'menu', component: MenuComponent},
  21. {path: 'reviews', component: ReviewsComponent}
  22. ]
  23. },
  24. {path: 'restaurants', component: RestaurantsComponent},
  25. {path: 'order', loadChildren: './order/order.module#OrderModule', canLoad: [LoggedInGuard] },
  26. {path: 'order-sumary', component: OrderSumaryComponent},
  27. {path: 'about', loadChildren: './about/about.module#AboutModule' },
  28. {path: '**', component: NotFoundComponent}
  29. ]
Add Comment
Please, Sign In to add comment