From 778b88c26e5b41a328d81d99b0b7a34bf4a26228 Mon Sep 17 00:00:00 2001 From: tliero Date: Thu, 12 May 2016 17:31:37 +0200 Subject: [PATCH] =?UTF-8?q?Autocomplete=20f=C3=BCr=20Notizfeld=20mit=20htt?= =?UTF-8?q?ps://github.com/JustGoscha/allmighty-autocomplete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- .../repository/TransactionRepository.java | 2 +- src/main/resources/data-h2.sql | 92 +++++++++---------- .../resources/static/css/autocomplete.css | 46 ++++++++++ src/main/resources/static/index.html | 7 +- src/main/resources/static/js/app.js | 2 +- .../resources/static/js/autocomplete.min.js | 1 + src/main/resources/static/js/controllers.js | 14 +++ .../static/partials/transaction-list.html | 5 +- 9 files changed, 119 insertions(+), 52 deletions(-) create mode 100644 src/main/resources/static/css/autocomplete.css create mode 100644 src/main/resources/static/js/autocomplete.min.js diff --git a/README.md b/README.md index f13ca93..9f3e842 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,10 @@ https://letsencrypt.org/getting-started/ # TODO - Transaktionen in Popup editieren/löschen als Admin -- Autocomplete für Notizfeld - Admin-Bereich - Auslagen zurücksetzen - (beliebig lange) Liste von Transaktionen anzeigen - CSV-Export +- TODO-Marker abarbeiten - Verschlüsselung aktivieren - Absicherung: DELETE darf von Usern nur auf die letzte Transaktion angewendet werden diff --git a/src/main/java/de/tilman/transactions/repository/TransactionRepository.java b/src/main/java/de/tilman/transactions/repository/TransactionRepository.java index 2a2f230..e72224b 100644 --- a/src/main/java/de/tilman/transactions/repository/TransactionRepository.java +++ b/src/main/java/de/tilman/transactions/repository/TransactionRepository.java @@ -26,7 +26,7 @@ public interface TransactionRepository extends PagingAndSortingRepository getDescriptionsByAccount(@Param("accountId") Long accountId, @Param("prefix") String prefix, Pageable pageable); @RestResource(path = "expenses") diff --git a/src/main/resources/data-h2.sql b/src/main/resources/data-h2.sql index 6c15bed..6e57c95 100644 --- a/src/main/resources/data-h2.sql +++ b/src/main/resources/data-h2.sql @@ -1,59 +1,59 @@ INSERT INTO User (id, name, username) VALUES (1, 'Adam', 'adam@mail.com'), (2, 'Betty', 'betty@mail.com'); INSERT INTO Account (id, name, owner_id) VALUES (1, 'Gemeinschaftskonto', 1), (2, 'Konto Adam', 1); -INSERT INTO Withdrawal(id, account_id, amount, user_id, date) VALUES (1, 1, 20.00, 2, '2015-06-12 18:20:15'); -INSERT INTO Withdrawal(id, account_id, amount, user_id, date) VALUES (2, 1, 10.00, 1, '2015-06-14 10:03:00'); +INSERT INTO Withdrawal(id, account_id, amount, user_id, date) VALUES (1, 1, 20.00, 2, '2016-04-12 18:20:15'); +INSERT INTO Withdrawal(id, account_id, amount, user_id, date) VALUES (2, 1, 10.00, 1, '2016-04-14 10:03:00'); INSERT INTO Category (id, name, account_id, position) VALUES (1, 'Essen - Lebensmittel', 1, 2), (2, 'Einnahmen - Gehalt', 1, 1), (3, 'Essen - Arbeit', 1, 3), (4, 'Einnahmen - Gehalt', 2, 1), (5, 'Technik - Server und Hosting', 2, 2); INSERT INTO Account_User (account_id, user_id) VALUES (1, 1), (1, 2), (2, 1); INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES - (NULL, 1280.81, 1, 2, '2015-06-01 14:14:14', 'Gehalt', null), - (NULL, -2.21, 1, 1, '2015-06-10', 'Brot', null), - (NULL, -3.41, 1, 1, '2015-06-12', 'Gemüse', null), - (NULL, -7.81, 1, 3, '2015-06-19', 'Kantine', null), - (NULL, -4.81, 1, 3, '2015-06-18', 'Currywurst', 1), - (NULL, -4.50, 1, 3, '2015-06-19', 'Currywurst', null), - (NULL, -4.50, 1, 3, '2015-06-20', 'Currywurst', null), - (NULL, -4.50, 2, 3, '2015-06-20', 'Currywurst', null), - (NULL, -4.09, 1, 3, '2015-06-18', 'Currywurst-Frühstück', null), - (NULL, -4.90, 1, 3, '2015-06-18', 'Currywurst (Auslage Betty)', 2), - (NULL, -8.90, 1, 3, '2015-06-18', 'Curry beim Inder (Auslage Adam)', 1), - (NULL, -12.00, 2, 3, '2015-06-18', 'Curry Thai', null), - (NULL, 1340.22, 2, 4, '2015-06-02', 'Gehalt Adam', null), - (NULL, -12.90, 2, 5, '2015-06-16', 'Host Europe', null); + (NULL, 1280.81, 1, 2, '2016-04-01 14:14:14', 'Gehalt', null), + (NULL, -2.21, 1, 1, '2016-04-10', 'Brot', null), + (NULL, -3.41, 1, 1, '2016-04-12', 'Gemüse', null), + (NULL, -7.81, 1, 3, '2016-04-19', 'Kantine', null), + (NULL, -4.81, 1, 3, '2016-04-18', 'Currywurst', 1), + (NULL, -4.50, 1, 3, '2016-04-19', 'Currywurst', null), + (NULL, -4.50, 1, 3, '2016-04-20', 'Currywurst', null), + (NULL, -4.50, 2, 3, '2016-04-20', 'Currywurst', null), + (NULL, -4.09, 1, 3, '2016-04-18', 'Currywurst-Frühstück', null), + (NULL, -4.90, 1, 3, '2016-04-18', 'Currywurst (Auslage Betty)', 2), + (NULL, -8.90, 1, 3, '2016-04-18', 'Curry beim Inder (Auslage Adam)', 1), + (NULL, -12.00, 2, 3, '2016-04-18', 'Curry Thai', null), + (NULL, 1340.22, 2, 4, '2016-04-02', 'Gehalt Adam', null), + (NULL, -12.90, 2, 5, '2016-04-16', 'Host Europe', null); -- add as many transactions as needed -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction01', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction02', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction03', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction04', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction05', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction06', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction07', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction08', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction09', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction10', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction11', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction12', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction13', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction14', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction15', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction16', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction17', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction18', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction19', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction20', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction21', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction22', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction23', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction24', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction25', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction26', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction27', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction28', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2015-06-10', 'Transaction29', null); Commit; -INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2015-06-10', 'Transaction30', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction01', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction02', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction03', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction04', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction05', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction06', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction07', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction08', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction09', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction10', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction11', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction12', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction13', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction14', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction15', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction16', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction17', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction18', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction19', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction20', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction21', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction22', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction23', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction24', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction25', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction26', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction27', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction28', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 1, '2016-04-01', 'Transaction29', null); Commit; +INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, -1.50, 1, 3, '2016-04-01', 'Transaction30', null); Commit; INSERT INTO Transaction (id, amount, account_id, category_id, date, description, creditor_id) VALUES (NULL, 1.50, 1, 4, CURRENT_TIMESTAMP()+1, 'LAST Transaction', null); Commit; diff --git a/src/main/resources/static/css/autocomplete.css b/src/main/resources/static/css/autocomplete.css new file mode 100644 index 0000000..0082d33 --- /dev/null +++ b/src/main/resources/static/css/autocomplete.css @@ -0,0 +1,46 @@ +/* AUTOCOMPLETE */ + +/* +.autocomplete { + width: 100%; + position: relative; +} + +.autocomplete input { + font-size: 1.2em; + width: 100%; + padding: 0.4em; +} +*/ + +.autocomplete ul { + position: absolute; + /*left: 0; + width: 100%;*/ + border-left: 1px solid #888; + border-right: 1px solid #888; + border-bottom: 1px solid #888; + z-index: 1; + padding-left: 0; +} + +.autocomplete li { + text-align: left; + list-style: none; + width: 100%; + padding:0; margin:0; + background-color: #fff; +} + +.autocomplete li.active { + background-color: #4bf; +} + +.autocomplete .highlight { + background-color: #E2E2E2; +} + +.autocomplete li.active .highlight { + background: #666; + color: #fff; +} \ No newline at end of file diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 6ec20a4..d0f8666 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -8,12 +8,17 @@ + - + + + + + diff --git a/src/main/resources/static/js/app.js b/src/main/resources/static/js/app.js index 5cd2676..43e2a8f 100644 --- a/src/main/resources/static/js/app.js +++ b/src/main/resources/static/js/app.js @@ -1,4 +1,4 @@ -var transactionsApp = angular.module('transactionsApp', ['ngRoute', 'transactionControllers' ]); +var transactionsApp = angular.module('transactionsApp', ['ngRoute', 'transactionControllers', 'autocomplete' ]); transactionsApp.config([ '$routeProvider', function($routeProvider) { $routeProvider.when('/list', { diff --git a/src/main/resources/static/js/autocomplete.min.js b/src/main/resources/static/js/autocomplete.min.js new file mode 100644 index 0000000..3371156 --- /dev/null +++ b/src/main/resources/static/js/autocomplete.min.js @@ -0,0 +1 @@ +var app=angular.module("autocomplete",[]);app.directive("autocomplete",function(){var e=-1;return{restrict:"E",scope:{searchParam:"=ngModel",suggestions:"=data",onType:"=onType",onSelect:"=onSelect",autocompleteRequired:"="},controller:["$scope",function(e){e.selectedIndex=-1,e.initLock=!0,e.setIndex=function(t){e.selectedIndex=parseInt(t)},this.setIndex=function(t){e.setIndex(t),e.$apply()},e.getIndex=function(t){return e.selectedIndex};var t=!0;e.completing=!1,e.$watch("searchParam",function(n,i){i===n||!i&&e.initLock||(t&&"undefined"!=typeof e.searchParam&&null!==e.searchParam&&(e.completing=!0,e.searchFilter=e.searchParam,e.selectedIndex=-1),e.onType&&e.onType(e.searchParam))}),this.preSelect=function(n){t=!1,e.$apply(),t=!0},e.preSelect=this.preSelect,this.preSelectOff=function(){t=!0},e.preSelectOff=this.preSelectOff,e.select=function(n){n&&(e.searchParam=n,e.searchFilter=n,e.onSelect&&e.onSelect(n)),t=!1,e.completing=!1,setTimeout(function(){t=!0},1e3),e.setIndex(-1)}}],link:function(t,n,i){setTimeout(function(){t.initLock=!1,t.$apply()},250);var a="";t.attrs={placeholder:"start typing...","class":"",id:"",inputclass:"",inputid:""};for(var r in i)a=r.replace("attr","").toLowerCase(),0===r.indexOf("attr")&&(t.attrs[a]=i[r]);i.clickActivation&&(n[0].onclick=function(e){t.searchParam||setTimeout(function(){t.completing=!0,t.$apply()},200)});var l={left:37,up:38,right:39,down:40,enter:13,esc:27,tab:9};document.addEventListener("keydown",function(e){var n=e.keyCode||e.which;switch(n){case l.esc:t.select(),t.setIndex(-1),t.$apply(),e.preventDefault()}},!0),document.addEventListener("blur",function(e){setTimeout(function(){t.select(),t.setIndex(-1),t.$apply()},150)},!0),n[0].addEventListener("keydown",function(n){var i=n.keyCode||n.which,a=angular.element(this).find("li").length;if(t.completing&&0!=a)switch(i){case l.up:if(e=t.getIndex()-1,-1>e)e=a-1;else if(e>=a){e=-1,t.setIndex(e),t.preSelectOff();break}t.setIndex(e),-1!==e&&t.preSelect(angular.element(angular.element(this).find("li")[e]).text()),t.$apply();break;case l.down:if(e=t.getIndex()+1,-1>e)e=a-1;else if(e>=a){e=-1,t.setIndex(e),t.preSelectOff(),t.$apply();break}t.setIndex(e),-1!==e&&t.preSelect(angular.element(angular.element(this).find("li")[e]).text());break;case l.left:break;case l.right:case l.enter:case l.tab:e=t.getIndex(),-1!==e?(t.select(angular.element(angular.element(this).find("li")[e]).text()),i==l.enter&&n.preventDefault()):i==l.enter&&t.select(),t.setIndex(-1),t.$apply();break;case l.esc:t.select(),t.setIndex(-1),t.$apply(),n.preventDefault();break;default:return}})},template:'
'}}),app.filter("highlight",["$sce",function(e){return function(t,n){if("function"==typeof t)return"";if(n){var i="("+n.split(/\ /).join(" |")+"|"+n.split(/\ /).join("|")+")",a=new RegExp(i,"gi");i.length&&(t=t.replace(a,'$1'))}return e.trustAsHtml(t)}}]),app.directive("suggestion",function(){return{restrict:"A",require:"^autocomplete",link:function(e,t,n,i){t.bind("mouseenter",function(){i.preSelect(n.val),i.setIndex(n.index)}),t.bind("mouseleave",function(){i.preSelectOff()})}}}); \ No newline at end of file diff --git a/src/main/resources/static/js/controllers.js b/src/main/resources/static/js/controllers.js index 30d9a0d..1c19b1b 100644 --- a/src/main/resources/static/js/controllers.js +++ b/src/main/resources/static/js/controllers.js @@ -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(); diff --git a/src/main/resources/static/partials/transaction-list.html b/src/main/resources/static/partials/transaction-list.html index 7821108..55645c8 100644 --- a/src/main/resources/static/partials/transaction-list.html +++ b/src/main/resources/static/partials/transaction-list.html @@ -51,10 +51,11 @@
Notiz:
- + +
- +