0
關於年份值的更改,我想更改Make下拉選項,但沒有獲取如何更新其他控件的選項。AngularJS,ng-change如何更新其他選擇控件的選項
下面是我與形式plunker。 https://plnkr.co/edit/aV65Nab9U9I6YlK2g4sY?p=preview
api.php
是服務器響應這些選項應顯示在下拉菜單上的變化年。
autoQuoteCtrl.js
$scope.updateMakeList = function(){
}
的index.html
<div class="row">
<div class="form-group">
<label class="col-sm-5 control-label" for="PC">{{questions[$state.current.name].VehicleYear.QuestionData._text}}</label>
<div class="col-sm-6">
<select ng-change="updateMakeList" custom-required="true" ng-options="ans._value as ans._promptText for ans in questions[$state.current.name].VehicleYear.QuestionData._answerOptions" ng-model="answers.VehicleYear" ng-required="queObj._required" class="form-control {{queObj._pageAttributes.cssclass}}" name="{{questions[$state.current.name].VehicleYear.QuestionData._attributeName}}" id="{{questions[$state.current.name].VehicleYear.QuestionData._attributeName}}" data-que-obj="questions[$state.current.name].VehicleYear.QuestionData" select-control-dir setMake custom-required></select>
</div>
</div>
<span class="form-error" ng-show="submitted && DTOstep1.VehicleYear.$error.required">This field is required.</span>
</div>