0

I am in Authenticate with authGuard. I would like to know the difference between these two

// Redirect to the login page

return router.navigate(['/login']);
return router.parseUrl('/login');

In Angular official documentation it is showing router.parseUrl('/login'); is used for redirecting to login page https://angular.io/guide/router-tutorial-toh#canactivate-requiring-authentication

enter image description here

But in other online tutorial website, they are using return router.navigate(['/login']);

What are the difference between these two?

Pamba
  • 776
  • 1
  • 16
  • 29

0 Answers0