Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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'}}" />
Add a comment
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
<button type="button" ng-click="actionAll();" class="btn btn-default">{{loading ? 'please wait...' : 'start'}}</button>
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.