我有一個代碼:ng-change工作不正確?
<select ng-options="i.id as i.os_version for i in devices"
ng-model="selected_version_os_to"
ng-change="selectVersion(i.id)">
<option value=''> Select version</option>
</select>
爲什麼我在控制檯中看到undefined
時,試圖顯示值:
ng-change="selectVersion(i.id)"
?
內selectVersionfunction
:我得到i.id
爲未定義:
$scope.selectVersion = function(item) {
console.log(item);
}