0
我已經搜索並嘗試了許多不同版本的代碼,但未找到任何答案。從選定的單選按鈕獲取angularjs值
我的代碼是:
<div class="well">
<h3>{{policies.aul.name}}</h3>
<ul style="list-style: none;">
<li ng-repeat="p in policies.aul.policies | orderBy:'!pName' ">
<input type="radio" ng-model="aulPolicy.checked" name="{{policies.aul.name}}" ng-value="{{p.pName}}" required /> {{p.pName}}
</li>
</ul>
selected: {{aulPolicy.checked}} or {{policies.aul.name}}
<input type="submit" class="btn btn-primary" onclick="javascript:generateTableA('{{aulPolicy}}')" value="Build">
<input ng-hide="!aData" type="submit" class="btn btn-primary" value="Add Table" disabled="true">
</span>
</div>
代碼:selected: {{aulPolicy.checked}} or {{policies.aul.name}}
不顯示任何檢查,它只表示aul.name。
任何想法?
下面我將我的JSON:
{"aul":{"name":"American United Life",
"policies":[{
"pName":"standard",
"header":[{"name":"Policy Year","total":false},{"name": "Age","total":false},
{"name":"Contract Premium","total":true},{"name":"Cash Value","total":false},
{"name":"PUA Cash Value","total":false},{"name":"Death Benefit","total":false},
{"name":"Total Annual Outlay","total":false},{"name":"PUA Cash Value","total":false},
{"name":"Total Net Cash Value","total":false},{"name":"PUA Death Benefit","total":false},
{"name":"OTA Death Benefit","total":false},{"name":"Total Net Death Benefit","total":false},
{"name":"Total","total":false}],
"cols":12
},
{"pName":"offset",
"header":[],
"cols":13
},
{"pName":"level trem",
"header":[],
"cols":13
},
{"pName":"blended term",
"header":[],
"cols":13
},
{"pName":"blended and level",
"header":[],
"cols":12
},
{"pName":"blended and level and offset",
"header":[],
"cols":15
}]
}
}
謝謝你的迴應,我看你的代碼是如何工作的,並十分感謝使用最雷的給我看。但是,我仍然沒有得到它在我的應用程序中工作。 –
我已經添加了我的json樣本,你有什麼想法嗎? –
我已將所有代碼用於測試,並且不適合我。我發現它在stackoverflow片段中運行良好。有任何想法嗎? –