Answers for "a router button angular"

1

set route on button in angular

<button type="button" class="btn btn-primary-outline pull-right" (click)="btnClick();"><i class="fa fa-plus"></i> Add</button>    

// myComponent.component.ts file 
import { Router } from '@angular/router';

constructor(private router: Router) {

}
// myComponent.component.thml
btnClick= function () {
        this.router.navigateByUrl('/user');
};
Posted by: Guest on February-09-2020
0

set route on button in angular

<button type="button" class="btn btn-primary-outline pull-right" (click)="btnClick();"><i class="fa fa-plus"></i> Add</button>
​
// myComponent.component.ts file.
import { Router } from '@angular/router';
​
constructor(private router: Router) {
​
}
Posted by: Guest on March-29-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language