Consider this scenario: I have two functions that are triggered by a button click:
<button ng-click="functionOne || functionTwo()"></button>
However, I want to optimize this setup so that the functions are only called if they return a value. If they don't return anything, I would like them to not be called at all and simply return null or another default value. I am currently exploring if it is possible to achieve this using a ternary operator, something like:
<button ng-click="condition ? functionOne || functionTwo() : null"></button>
In this case, the functions will only be executed if condition
evaluates to true.
I have experimented with this approach, but it doesn't seem to work as expected :|