Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how click button and redirect angular

<a class="btn" routerLink="/votes">Check votes</a>
Comment

how click button and redirect angular

import { Component } from '@angular/core';
import { Router } from '@angular/router';
// component details here...
export class MyComponent  {
  constructor(private router: Router){ }

  goToVotes($myParam: string = ''): void {
    const navigationDetails: string[] = ['/votes'];
    if($myParam.length) {
      navigationDetails.push($myParam);
    }
    this.router.navigate(navigationDetails);
  }
}
Comment

how click button and redirect angular

<button class="btn" (click)="goToVotes()">Check votes</button>
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to add eslint to react project 
Javascript :: declare function javascript 
Javascript :: get in redis 
Javascript :: jquery check if document loaded 
Javascript :: simple js drawing program 
Javascript :: xor in javascript 
Javascript :: 1. Write regular expression to describe a languages consist of strings made of even numbers a and b. CO1 K3 
Javascript :: javascript regex stop at first match 
Javascript :: angular how to check a radiobox 
Javascript :: add decimals javascript 
Javascript :: javascript cancel scroll 
Javascript :: java convert json string to list of maps 
Javascript :: javascript read text file from url 
Javascript :: js sleep function with argument 
Javascript :: await loop javascript 
Javascript :: toggle boolean state react 
Javascript :: recursive reverse string 
Javascript :: disable input box javascript 
Javascript :: redirect to website from promise value fetch 
Javascript :: Object of type * is not JSON serializable 
Javascript :: change inside div with jquery 
Javascript :: array find 
Javascript :: vuejs alerts 
Javascript :: http module in nodejs 
Javascript :: how to get first element of an array in javascript 
Javascript :: how to check if something is array javascript 
Javascript :: make property read-only javascript 
Javascript :: crypt a string jquery 
Javascript :: dm message collector discordjs 
Javascript :: how to detect click outside div 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =