Hi Sander,

Thanks. Issue resolved by this suggestion . 


On Thursday, June 13, 2019 at 2:39:53 PM UTC+5:30, Sander Elias wrote:
>
> 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/110d1b8b-f168-4997-9bc0-024c7b98e15e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to