angular: toggle text of button based on boolean value in model

angularjs, javascript

Solution

Should use like that :

<button> {{ cond_vall == true ? 'Case 1' : 'Case 2' }}</button>

Problem

What is a simple way to change the text in a button element based on a boolean value? pseudo code: ``` <button> some text OR some other text </button> ``` I read this: Angularjs if-then-else construction in expression and this regarding ng-switch: http://docs.angularjs.org/api/ng.directive:ngSwitch Neither seems to work using bool value from model

Original source

Related problems