【发布时间】:2016-05-13 19:32:38
【问题描述】:
<input type="radio" ng-checked="pooledFunds.acceptPooledFunds == 1">
<input type="radio" ng-checked="pooledFunds.acceptPooledFunds == 1"> {{pooledFunds.acceptPooledFunds}} , {{pooledFunds.acceptPooledFunds == 1}}
并且我有一个 JSON 对象分配给我的控制器中的范围变量,例如
$scope.pooledFunds = {"acceptPooledFunds" : 1};
使用 {{pooledFunds.acceptPooledFunds}} 打印的值 pooledFunds.acceptPooledFunds 显示 1 并且 {{pooledFunds.acceptPooledFunds == 1}} 显示 true。
但是单选按钮没有变成选中模式。 我已经检查了这个链接:angular ng-checked is not working for radio
这并没有帮助。
【问题讨论】:
-
你想要一个收音机还是一个复选框?
-
收音机没有 ng-checked。请参阅angular docs。
标签: javascript angularjs