angular routing for a button code example
Example: add a route to a buttoin in angular
// myComponent.component.ts file
import { Router } from '@angular/router';
constructor(private router: Router) {
}
// myComponent.component.thml
btnClick= function () {
this.router.navigateByUrl('/user');
};