0
angularjs 및 autocomplete의 마지막 문제를 해결하기 위해 SOF에게 감사드립니다. 이제 Angularjs with jquery auto complete not working자동 완성 기능을 사용하여 ng-repeat 변수를 업데이트하는 방법은 무엇입니까?
, 나는
<tr data-ng-repeat="item in pagedItems">
<td title={{item.name}}>{{item.name}}</td>
<td> <input type=text auto-complete ng-model="item.upload_status">
Upload status: {{item.upload_status}}</td>
<td title={{item.lat}}>{{item.lat}}</td>
<td title={{item.lon}}>{{item.lon}}</td>
</tr>
지침에서 NG-반복에서 동일한 유형의 문제 ...
보기에서이
myapp.directive('autoComplete', function(autoCompleteDataService) {
return {
restrict: 'A',
link: function(scope, elem, attr, ctrl) {
elem.autocomplete({
source: autoCompleteDataService.getSource(),
select: function(event, ui) {
scope.$apply(function() { this.item.upload_status = ui.item.value; });
},
change: function (event, ui) {
if (ui.item === null) {
scope.$apply(function() { scope.foo = null });
}
},
minLength: 2
});
}
};
});
그것은 같은 오류를주고는,
형식 오류 : 정의되지 않은
감사 upload_status를 업데이트 할 어떤 생각의 설정할 수 없습니다 재산 'upload_status'..
시도해야한다' scope.item.upload_status' 대신'this.item.upload_status' – AlwaysALearner
Worked CodeHater .. 감사합니다.이 각도를 연구하는 방법 .. 시작하기가 어렵습니다 .. 대답으로 추가하십시오 .. – Kumar
angularjs.org에서 제공하는 자습서를 통해 기본 사항을 명확하게 이해할 수 있습니다. – AlwaysALearner