Button:
<input type="submit" value="{loading : 'please wait...', !loading : 'start'}" />
However this does not work. I get the expression as value instead of please wait/start. Is there a built in angular directive to do this?
Maybe you are looking something like
<input type="submit" value="{{loading && 'please wait...' || 'start'}}" />
It works like ternary operator.
And if you are using Angular 1.1.5 or above this would work
<input type="submit" value="{{loading ? 'please wait...' : 'start'}}" />
This may be old, but I thought I'd add this answer for button specific tag, since setting the value of button wasn't working for me. I needed to add this as follows.
<button type="button" ng-click="actionAll();"
class="btn btn-default">{{loading ? 'please wait...' : 'start'}}</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With