angular-ui

This commit is contained in:
2016-06-12 14:00:12 +02:00
parent 2724df1b23
commit 7100805189
5 changed files with 28 additions and 46 deletions
+1 -18
View File
@@ -218,30 +218,13 @@ transactionControllers.controller('TransactionListCtrl', [ '$http', '$scope', '$
}
};
$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;
});
}
$scope.getLocation = function(val) {
$scope.updateSuggestions = function(val) {
var suggestions = $resource('http://localhost:8080/transactions/search/descriptions', { accountId: $scope.account.id, prefix: val.toLowerCase() }).get();
return 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;
}
return newSuggestions;
});
};