Amit Kumar Singh

Amit Kumar Singh

  • 381
  • 3.9k
  • 196.4k

How to optimize below line of code

Feb 13 2019 4:29 AM
Hi,
<button (click)='Button1'></button>
<button (click)='Button2'></button>
<button (click)='Button3'></button>
Button1(){
this.router.navigate(['/home']);
Button2(){
this.router.navigate(['/home']);
Button3(){
this.router.navigate(['/home']);
I need to optimize above highlighted code.
Thanks!!!

Answers (3)