这是html页面
<form name="createPromoterFormName">
<div class="col s12" ng-repeat="customer in model.customers" ng-if="model.selectedCustomerSubtab == $index">
<div class="row inputcontainer">
<div class="input-field col s4">
<input placeholder="First Name" type="text" ng-model="customer.customer_name" class="validate" ng-maxlength="50" ng-required="true" />
<label class="active labelName">Customer Name </label>
</div>
<div class="input-field col s4">
<input type="text" class="validate" ng-maxlength="50" ng-required="true" ng-model="customer.avg_monthly_sales" />
<label class="active labelName">Average Monthly Sales </label>
</div>
<div class="input-field col s4">
<select ng-model="customer.avg_payment_cycle_days" ng-options="i.value as i.value for i in model.avgPaymentCycleDays" ng-change="changeSelectedItem()">
<option value="">Select Average Payment Cycle Days</option>
</select>
<label class="labelName">Avg Payment Cycle Days [[customer.avg_payment_cycle_days]]</label>
</div>
</div>
<div class="row inputcontainer">
<div class="input-field col s4">
<input type="text" class="validate" ng-maxlength="50" ng-model="customer.avg_paymmonths_in_business_with_customerent_cycle_days" />
<label class="active labelName">Months in business with customer</label>
</div>
</div>
</div>
</form>
控制器.js
$scope.model = {
customers: [{
customer_name: "",
avg_monthly_sales: "",
avg_payment_cycle_days: "",
months_in_business_with_customer: ""
}, {
customer_name: "",
avg_monthly_sales: "",
avg_payment_cycle_days: "",
months_in_business_with_customer: ""
}, {
customer_name: "",
avg_monthly_sales: "",
avg_payment_cycle_days: "",
months_in_business_with_customer: ""
}],
avgPaymentCycleDays : [{
value: '15',
id: '1'
}, {
value: '30',
id: '2'
}, {
value: '45',
id: '3'
}, {
value: '60',
id: '4'
}, {
value: '75',
id: '5'
}, {
value: '90',
id: '6'
}],
selectedPromoterSubtab: 0,
selectedCustomerSubtab: 0,
}
$scope.changeSelectedItem = function() {
console.log($scope.model.customers);
}
我正在使用材料 css。当我选择选项时,ng-change 没有触发,也没有将数据绑定到 ng-model。
任何人都可以帮助我我在哪里犯错误?