1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Using routerLink and (click) in same button

Discussão em 'Angular' iniciado por dilantha111, Outubro 16, 2024 às 01:53.

  1. dilantha111

    dilantha111 Guest

    This is asking about a best practice. Is it a good practice to use routerLink and (click) in same button.

    <button routerLink="/link" (click)="back()">


    Because we can put the router navigation logic in the back() method, like below,

    this.router.navigate(['/link']);


    All I found regarding this is, this article which was not talking about the best practice to follow. If one is better than the other, can you explain the reason.

    Continue reading...

Compartilhe esta Página