I don't know why , but when I try to set the $scope variables Inside the autocomplete , nothing happens , well the $scope variables got undefined,($scope.shipperdescripcion and $scope.shipperlocation) but I need to know how to make it work , thx
$(".shipper").autocomplete({
minLength: 3,
source: "controllers/search.php?catalogo=plantas",
select: function(event, ui, $scope){
$(this).val(ui.item.value).change();
$scope.shipperdescripcion = ui.item.id;
$scope.shipperlocation = ui.item.desc;
return false;
},
change: function (event, ui, $scope) {
if (ui.item == null) {
$scope.shipperdescripcion = '';
$scope.shipperlocation = '';
}
}
})
.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
return $( "<li>" )
.data( "item.autocomplete", item)
.append( "<a><b>" + item.value + "</b><br>" + item.desc + "</a>" )
.appendTo( ul );
};
$scope.$apply().