Answers for "angular router navigate current route"

1

angular go to route

import {Router} from '@angular/router';

constructor(private router: Router) {}

navigateToLogin() {
   this.router.navigateByUrl('/login');
}
Posted by: Guest on March-22-2021
3

angular get current route

this.router.url === '/login'
Posted by: Guest on December-27-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language