Fix wrong scope access

This commit is contained in:
Jesús Ángel González 2018-05-10 17:09:56 +02:00 committed by Javier Castro
parent 398d048038
commit 49d214603b
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<div layout="row" flex class="wz-margin-bottom-10">
<input ng-if="!isdisabled" flex id="query" placeholder="{{ placetext }}" ng-class="height ? height : ''" type="text" ng-model="term" ng-change="applyDelayAndFilter()"
<input ng-if="!isdisabled" flex id="query" placeholder="{{ placetext }}" ng-class="height ? height : ''" type="text" ng-model="term" ng-change="applyDelayAndFilter(term)"
class="wz-search-bar-size groupsNoMarginTop input-filter-box wz-width-100" />
<input ng-if="isdisabled" disabled flex id="query" placeholder="{{ placetext }}" ng-class="height ? height : ''" type="text" ng-model="term" ng-change="applyDelayAndFilter()"
<input ng-if="isdisabled" disabled flex id="query" placeholder="{{ placetext }}" ng-class="height ? height : ''" type="text" ng-model="term" ng-change="applyDelayAndFilter(term)"
class="wz-search-bar-size groupsNoMarginTop input-filter-box wz-width-100" />
</div>

View File

@ -26,8 +26,8 @@ app.directive('wzSearchBar', function() {
isdisabled: '=isdisabled'
},
link: function(scope, ele, attrs) {
scope.applyDelayAndFilter = () => {
setTimeout(() => scope.data.addFilter('search', scope.term),200)
scope.applyDelayAndFilter = searchTerm => {
setTimeout(() => scope.data.addFilter('search', searchTerm),200)
}
},
template: searchBarTemplate