Answers for "how to redirect to the same page in different section when button onclick in angular"

0

how click button and redirect angular

<a class="btn" routerLink="/votes">Check votes</a>
Posted by: Guest on November-30-2020
0

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);
  }
}
Posted by: Guest on November-30-2020

Code answers related to "how to redirect to the same page in different section when button onclick in angular"

Code answers related to "Javascript"

Browse Popular Code Answers by Language