Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add a route to a buttoin 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');
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #route #buttoin #angular
ADD COMMENT
Topic
Name
4+6 =