角度1. *フォームのラジオボタン - ブレークは
をNG-チェックは、私が持っている:コントローラで
<div class="filter-column">
<div class="filter-title">Market</div>
<div class="bottom-line"></div>
<div class="overflow-container">
<input type="radio" value="all" name="marketRadio"
ng-checked="true" class="resetAll" ng-model="filter.markets"
ng-change="radioMap('market')" checked>All
<div ng-repeat="choice in markets| orderBy: 'name'">
<input type="radio" value="{{choice.name}}" name="marketRadio"
ng-change="radioMap('market')" ng-model="filter.markets" >
{{choice.description}}
</div>
</div>
は私が持っている:
var ppvFilter = {
regions: [],
markets: [],
dealers: []
};
$scope.$watchCollection(function() {
return ppvFilter;
},
function(newValue) {
$scope.regions = newValue.regions;
$scope.markets = newValue.markets;
$scope.dealers = newValue.dealers;
});
ppvFilter.markets.length = 0; ppvFilter.markets = ppvFilter.markets.concat(['a', 'b', 'c'])
でプログラムでラジオボタンリストをリフレッシュ(ページリフレッシュではない)すると、ラジオボタンの選択肢のリストがguiのように更新されます。ただし、ng-checked="true"
はall
で動作しなくなり、リストが更新されるとチェックが外されます。
新しいラジオボタンのリストを表示しているにもかかわらず、角度のあるフォームが古いメモリを参照していると思われます。
ああ.... [OK]をクリックします。私はそれを 'ng-change() 'と一緒に使う必要があります。助言がありますか? – dman
ng-modelおよびng-changeがなくても、同じ動作です。 – dman
あなたはそれをプランナーまたはフィドルに入れることができますか? –