how click button and redirect angular
<a class="btn" routerLink="/votes">Check votes</a>
how click button and redirect angular
<a class="btn" routerLink="/votes">Check votes</a>
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);
}
}
how click button and redirect angular
<button class="btn" (click)="goToVotes()">Check votes</button>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us