我有一塊手錶region
,但當單擊單選按鈕時它不會觸發。角度無線電按鈕不會燒上手錶
我做錯了什麼或者是因爲單選按鈕只檢測到一次角度變化?無論如何,這不使用表單?
<div class="filter-column">
<div class="filter-title">Region</div>
<div class="bottom-line"></div>
<div class="overflow-container">
<div ng-repeat="choice in regions| orderBy: 'description'">
<input type="radio"
value="{{choice.name}}"
name="regionRadio"
ng-model="region">
{{choice.description}}
</div>
</div>
</div>
$scope.$watchCollection(watchRMDapisPopulate,
populateRMDfiltersView);
function watchRMDapisPopulate() {
return regionMarketDealerSrv.orgFilterData;
}
function populateRMDfiltersView(newValue, oldValue) {
if (newValue) {
$scope.regions = newValue.regions;
}
}
$scope.$watch('region', radioButtonRegion);
function radioButtonRegion(regionName) {
console.log(regionName)
if (regionName === 'All') {
regionMarketDealerSrv.populateRegions();
} else {
regionMarketDealerSrv.populateMarkets(regionName);
}
}
嘗試更改值= 「{{choice.name}}」 到NG-值=「{{選擇.name}}「 –
」將其更改爲「ng值」,但仍然沒有成功。沒有'console.log(regionName)'輸出。 – dman
如何使用功能作爲手錶表達? $ scope。$ watch(function(){return $ scope.region;},radioButtonRegion) –