Angular (click) - multiple functions?

kristijanfistrek

KristijanFištrek

Posted on June 14, 2019

Angular (click) - multiple functions?

Scenario
-> on click of a button you need to check data from two functions with (click) attribute.

Do you :
A) create a third function which encapsulates the two & pass that in the (click).
Example : (click)="thirdFunction()"
B) you pass both of them.
Example :
(click)="first(); second();"

What seems to be the best practice for you?

💖 💪 🙅 🚩
kristijanfistrek
KristijanFištrek

Posted on June 14, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related