根据 bool 值更改按钮元素中文本的简单方法是什么?
伪代码:
<button> some text OR some other text </button>
我读到这个:Angularjs if-then-else construction in expression
关于 ng-switch:http://docs.angularjs.org/api/ng.directive:ngSwitch
使用模型中的 bool 值似乎都不起作用
最佳答案
应该这样使用:
<button> {{ cond_vall == true ? 'Case 1' : 'Case 2' }}</button>
关于javascript - Angular : toggle text of button based on boolean value in model,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21440288/