I have this AuthGuard. In this code I want to create a condition. If my resetpasss is not null I want to navigate in here ResetPassIdComponent else I want to navigate in Log
You can add the condition in CanActivate() itself. Can you tried like the below?
canActivate(): boolean { this.geturl(); if (this.auth.isAuthenticated()) { return true; } else if(this.resetpasss){ this.router.navigate([this.myappurl]); }else{ this.router.navigate(['/outsidelogin/login']); } }