I have the following scenario; I have two functions that are actioned from a button:
<button ng-click="functionOne || functionTwo()"></button>
now I want to optimise a bit that and I want to call these functions only when they return something, anything , otherwise I don't want to be called and to return null or something. Now I'm wondering if is possible to use ternary operator having something like:
<button ng-click="condition ? functionOne || functionTwo() : null"></button>
calling the functions only when condition is true.
I have tested and is not really worked :|
functionOneis doing?functionOnea flag or a function? if function, you need to call it.functionOne()is falsy, you want to callfunctionTwo()?