如何在 AngularJS 中更改按钮的文本?

How can I make the text of a button change in AngularJS?

我有一个 HTML 按钮:

<button>     </button>

如何根据 $scope 变量的值进行内部更改?

$scope.action == Action.Authenticating

我希望它在为假时说 "Sign in",在为真时说 "Signing in..."。

给你:

<button>{{action ? 'Signing in...' : 'Sign in'}}</button>

您可以在绑定中使用 ternary operator

<button>{{action === "someValue" ? "Primary" : "Alternate"}}</button>