[英]How can I change the text of a button when it is disabled using AngularJS?
[英]How can I make the text of a button change in AngularJS?
我有一个HTML按钮:
<button> </button>
如何根据$ scope变量的值在内部进行更改?
$scope.action == Action.Authenticating
如果不正确,我想说“登录”,如果不正确,我要说“登录...”。
您可以在绑定内使用三元运算符 :
<button>{{action === "someValue" ? "Primary" : "Alternate"}}</button>
干得好:
<button>{{action ? 'Signing in...' : 'Sign in'}}</button>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.