Guest User

Untitled

a guest
Mar 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. */my-account/overview // homepage
  2. */my-account/my-stuff
  3. */profile
  4. */non-default
  5.  
  6. export const routes: Routes = [
  7. { path: '', redirectTo: 'my-account', pathMatch: 'full' }, // should redirect to localhost:4200/my-account
  8. { path: '', component: DefaultComponent, children: [
  9. { path: 'my-account', children: [
  10. { path: '', redirectTo: 'overview', pathMatch: 'full' }, // should redirect to localhost:4200/my-account/overview
  11. { path: 'overview', component: OverviewComponent }, // should resolve: localhost:4200/my-account/overview
  12. { path: 'my-stuff', component: MyStuffComponent } // should resolve: localhost:4200/my-account/my-stuff
  13. ]},
  14. { path: 'profile', component: ProfileComponent } // should resolve: localhost:4200/profile
  15. ]},
  16. { path: 'non-default', component: NonDefaultComponent } // should resolve: localhost:4200/non-default
  17. ];
  18.  
  19. <nav>
  20. <ul>
  21. <li *ngFor="let menuItem of menuItems">
  22. <a [routerLink]="menuItem.url">
  23. <div>{{ menuItem.label }}</div>
  24. </a>
  25. </li>
  26. </ul>
  27. </nav>
  28.  
  29. <nav>
  30. <ul>
  31. <li *ngFor="let menuItem of menuItems">
  32. <a routerLink="menuItem.url">
  33. {{ menuItem.label }}
  34. </a>
  35. </li>
  36. </ul>
  37. </nav>
Add Comment
Please, Sign In to add comment