Autocomplete für Notizfeld mit
https://github.com/JustGoscha/allmighty-autocomplete
This commit is contained in:
@@ -218,6 +218,20 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
||||
}
|
||||
};
|
||||
|
||||
$scope.updateSuggestions = function(typed) {
|
||||
var suggestions = $resource('http://localhost:8080/transactions/search/descriptions', { accountId: $scope.account.id, prefix: typed.toLowerCase() }).get();
|
||||
suggestions.$promise.then(function(data) {
|
||||
console.log(suggestions);
|
||||
|
||||
var newSuggestions = new Array(suggestions._embedded.transactions.length);
|
||||
for (i = 0; i < suggestions._embedded.transactions.length; i++) {
|
||||
newSuggestions[i] = suggestions._embedded.transactions[i].description;
|
||||
}
|
||||
|
||||
$scope.descriptionSuggestions = newSuggestions;
|
||||
});
|
||||
}
|
||||
|
||||
// initialize (http://stackoverflow.com/a/25662066/3761783)
|
||||
$scope.initList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user