Спасибо SOF за решение моей последней проблемы с angularjs и автозаполнением. Angularjs с автозаполнением jquery не работает
Теперь у меня проблема того же типа в 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>
В директиве
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
});
}
};
});
Это дает ошибку, как,
TypeError: невозможно установить свойство «upload_status» неопределенного
Любая идея обновить upload_status приветствуется.
scope.item.upload_status
вместоthis.item.upload_status
- person AlwaysALearner   schedule 25.09.2013