Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. ______________________________________________
  2. Routing:
  3. const routes: Routes = [
  4. {
  5. path: '', canActivate: [AuthGardGuard], component: HomeComponent , children: [
  6. {path: 'builder', component: ViewBuilderComponent, outlet: 'builder'},
  7. {path: 'settings', component: SettingsComponent, outlet: 'builder'},
  8. ]
  9. },
  10. {path: 'login', component: LoginComponent}
  11. ];
  12. _________________________________________________
  13. Main outlet
  14. <router-outlet></router-outlet>
  15. ________________________________________________
  16. HomeComponent:
  17. <div>
  18. <a [routerLink]="['settings']"
  19. routerLinkActive="active-link"><mat-icon svgIcon="tune"></mat-icon> <span class="">settings</span></a>
  20. <a [routerLink]="['builder']"
  21. routerLinkActive="active-link"><mat-icon svgIcon="tune"></mat-icon> <span class="">builder</span></a>
  22. <div class="router">
  23. <router-outlet name="builder"></router-outlet>
  24. </div>
  25. </div>
  26.  
  27. Result is Cannot match any routes. URL Segment: 'builder'
  28. or Cannot match any routes. URL Segment: 'settings'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement