From 806d6659a5f38f47bf09060681db8adc2c83aa98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20=C3=81ngel=20Gonz=C3=A1lez?= Date: Thu, 10 May 2018 13:03:08 +0200 Subject: [PATCH] Added delay before fetch data --- public/directives/wz-search-bar/wz-search-bar.html | 4 ++-- public/directives/wz-search-bar/wz-search-bar.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/directives/wz-search-bar/wz-search-bar.html b/public/directives/wz-search-bar/wz-search-bar.html index fa66a1b80..c80c276ba 100644 --- a/public/directives/wz-search-bar/wz-search-bar.html +++ b/public/directives/wz-search-bar/wz-search-bar.html @@ -1,6 +1,6 @@
- -
diff --git a/public/directives/wz-search-bar/wz-search-bar.js b/public/directives/wz-search-bar/wz-search-bar.js index 29132d676..cd20dcea4 100644 --- a/public/directives/wz-search-bar/wz-search-bar.js +++ b/public/directives/wz-search-bar/wz-search-bar.js @@ -26,7 +26,9 @@ app.directive('wzSearchBar', function() { isdisabled: '=isdisabled' }, link: function(scope, ele, attrs) { - + scope.applyDelayAndFilter = () => { + setTimeout(() => scope.data.addFilter('search', scope.term),200) + } }, template: searchBarTemplate }