Hi Ruchin, This is because your apiService.isLogin is async. The router starts 'routing' only after the router-outlet is available. what happens is, your route to `/someRoute`. Router-outlet is not in the template. nothing happens. Afterward, your login result comes back, the outlet gets added to the view. there are no routing events, so nothing happens. This kind of security is better solved with a routerGuard.
Regards Sander -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/34981925-54c1-487f-b2a1-e75bdb4f1ab6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
