Search
 
SCRIPT & CODE EXAMPLE
 

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');
};
Comment

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) {
​
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: track window size js 
Javascript :: mouse coordinates not math with canvas coordinates in js 
Javascript :: jquery for table Show entries 
Javascript :: change window location javascript 
Javascript :: capitalize first letter of every word javascript 
Javascript :: javascript localStorage clear items 
Javascript :: if document is loaded 
Javascript :: boton de copiar en html y js 
Javascript :: document delete element 
Javascript :: get variable name javascript 
Javascript :: install react with old version of node 
Javascript :: javascript endswith 
Javascript :: Valid Time javascript 
Javascript :: js strip_tags 
Javascript :: express check if object is empty 
Javascript :: react router external link 
Javascript :: sequelize order includes 
Javascript :: parse json express 
Javascript :: javascript timestamp to relative time 
Javascript :: array alphabet 
Javascript :: dd.mm.yyyy pattern regex 
Javascript :: javascript group by property array of objects 
Javascript :: sequelize pagination postgres 
Javascript :: js get number from string 
Javascript :: javascript get date of last monday 
Javascript :: react link underline 
Javascript :: move list items up and down using javascript 
Javascript :: remove whitespace with regex javascript 
Javascript :: ionic 4 how to iterate json object in view 
Javascript :: jquery get value radio by name 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =