There's a button that should display a toggle only when the value is greater than 0; otherwise, it shouldn't do anything.
This snippet of code shows how things were prior to adding ng-if
:
<span >{{values.valuesNumber}}
<i class="fas fa-caret-down" ng-click="$ctrl.doSomething(values)">
</i>
</span>
The intention is to trigger the function from ng-click
only if values.valuesNumber > 0
.
To achieve this, I made the following changes but encountered some issues:
<span >{{values.valuesNumber}} <i class="fas fa-caret-down">
<span ng-if="values.valuesNumber > 0">
<span ng-click="$ctrl.doSomething(values)">
</span>
</span>
</i></span>