Category : angular-router

I have a navbar and my app.component.html : <div id="navigation"> <ul> <li class="active"><a routerLink="accueil">Accueil</a></li> <li><a routerLink="apropos" >A propos de nous</a> </li> <li class="has-sub" ><a routerLink="" >Payer</a> <ul> <li><a routerLink="payer/nat" >Vol national</a></li> <li><a routerLink="payer/int" >Vol international</a></li> </ul> </li> <li><a routerLink="temoin" >Temoignages</a> <li><a routerLink="contact">Contact</a> </li> </ul> </div> <router-outlet></router-outlet> I have also my app-routing file : const routes: ..

Read more

I need to wait for my Angular PWA to be stable within my guard in order to be able to setup Service Worker update polling with swUpdate.checkForUpdate(), otherwise the new version detection won’t work. That’s why I’m working with applicationRef.isStable observable so I can wait for the application to be stable before resolving canActivate(). The ..

Read more

I’m new to Angular and still learning it. I hope someone can help with my question. I have a component which subscribes to the router NavigationEnd event which accesses some varibles initialized in a route resolve from a service. constructor(private route: ActivatedRoute, private router: Router) { var that = this; this.router.events.subscribe((event) => { if (event ..

Read more

I’m trying to get a URL GET parameter named ‘loc’ when visiting localhost:4200/?loc=en_LSM_US. The method’s logic is that if the loc parameter is not sent to the actual page, then the locale will be calculated. I’m trying to get the parameter using this.route.snapshot.queryParamMap.get(‘loc’); but since the actual component is not a router outlet, the route ..

Read more

I am using nested routing like this what i am expecting it should show test2Component on upper level of router-outlet which is in app.component.html if the router-outlet is not exist in testComponent. const appRoutes: Routes = [ { path: "", component: TestComponent, children: [{ path: "test2", component: Test2Component }] } ]; Playground Source: Angular..

Read more