Hi,
Button1(){
this.router.navigate(['/home']);
Button2(){
this.router.navigate(['/home']);
Button3(){
this.router.navigate(['/home']);
I need to optimize above highlighted code.
Thanks!!!
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Madan ShekarRank #428 · 5.9K reputationPosted Feb 12, 2019, 11:40 PM EST
Amit Kumar SinghRank #562 · 4.3K reputationPosted Feb 12, 2019, 11:48 PM EST
Muthu KumarRank #935 · 2.2K reputationPosted Feb 18, 2019, 6:06 PM EST
Here is an optimized dynamic button creation working example,
I hope its helpful to you.