【发布时间】:2017-03-30 09:18:17
【问题描述】:
我在 ng-repeat 中有一个输入类型的收音机。 整个 div 加载在一个弹出窗口中,所以我通过 parentScope 访问控制器属性。
<div ng-repeat="name in parentScope.PatientInfo">
<input type="radio" id="select-radio-{{$index}}" ng-class="{'radio-btn':true, 'newpaymentmethod1' : true}"
ng-model="parentScope.nameObject" name="object">
</div>
我得到了parentScope.PatientInfo 的值,但我的输入类型单选在默认情况下或点击时都没有被选中。
我尝试将value and ng-value 提供给我的输入类型收音机,但都是徒劳的。
【问题讨论】:
-
你能添加你的完整代码吗?
-
nameObject 中有什么?
-
在控制器中... parentScope.PatientInfo 和 parentScope.nameObject... 都在同一个控制器中
-
你没有使用
nameng-repeat 的迭代器?,验证你的ng-model="parentScope.nameObject" -
我得到一个对象.... { "name": "something" "zipCode": "80166", "addressType": "shipToHome" }
标签: javascript angularjs