Autocomplete für Notizfeld mit

https://github.com/JustGoscha/allmighty-autocomplete
This commit is contained in:
2016-05-12 17:31:37 +02:00
parent 6ad9c2d186
commit 778b88c26e
9 changed files with 119 additions and 52 deletions
@@ -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();