나는이반복 항목은
<select id="categoryListBox"
data-ng-model="list"
data-ng-change="updateCategory(item)"
data-ng-options="item as item.categoryId[0].name+' : '+item.name for item in list"
class='form-control' >
<option value="" style="display:none;"> current category </option>
</select>
을 그리고 updateCategory
이 공격 할 때마다, 나는 선택 항목되어야 매개 변수를 console.log
. console.log
은 undefined
으로 읽습니다.
도 console.log
모델 $scope.list
이고 내가 선택한 item
으로 대체됩니다.
무슨 일 이니? 여기
는$scope.updateCategory = function(item){
console.log('updateCategory hit');
console.log('list is now',$scope.list)
console.log(item);
};
이 기능을 감싸
updateCategory hit
list is now [what item should be]
undefined
HTML로 나오는 updateCategory
기능입니다 이상이있는 경우 ng-hide
의