3
Answers

How to optimize below line of code

Photo of Amit Kumar Singh

Amit Kumar Singh

6y
648
1
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)