diff options
author | Jimmy Huynh <jimmy.huynh@etu.unistra.fr> | 2021-01-04 15:16:30 +0100 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2021-04-08 23:17:31 +0200 |
commit | cf00206da0b95c3c3e51f37982bc7f076e5f4b28 (patch) | |
tree | 42a0985576a59fa25e4330e62afb45bac262a236 /js | |
parent | 2e151f6e14f822fcf686c3d46cc1f9340f4f6659 (diff) |
(+) Dynamic userlist on input change
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'js')
-rw-r--r-- | js/controller/ContentController.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/js/controller/ContentController.js b/js/controller/ContentController.js index 018c15238..0def46a15 100644 --- a/js/controller/ContentController.js +++ b/js/controller/ContentController.js @@ -223,8 +223,18 @@ app.controller('ContentController', function (Publisher, FeedResource, ItemResou this.activeItem = this.getFirstItem(); + this.userList = []; + this.searchUsers = function(search) { - return UserResource.getUsers(search); + if (search === '') { + this.userList = []; + return; + } + + var response = UserResource.getUsers(search); + response.then((response) => { + this.userList = response.ocs.data.users; + }); }; -}); +});
\ No newline at end of file |