1<button type="button" class="btn btn-primary-outline pull-right" (click)="btnClick();"><i class="fa fa-plus"></i> Add</button>
2
3// myComponent.component.ts file
4import { Router } from '@angular/router';
5
6constructor(private router: Router) {
7
8}
9// myComponent.component.thml
10btnClick= function () {
11 this.router.navigateByUrl('/user');
12};
13
1
2<button type="button" class="btn btn-primary-outline pull-right" (click)="btnClick();"><i class="fa fa-plus"></i> Add</button>
3
4// myComponent.component.ts file
5import { Router } from '@angular/router';
6
7constructor(private router: Router) {
8
9}
10// myComponent.component.thml
11btnClick= function () {
12 this.router.navigateByUrl('/user');
13};