The custom filter:searchFilter
is functioning properly in regular HTML. Here's a demo: http://codepen.io/anon/pen/Oyydxa. However, the same function does not seem to work within the Ionic framework.
<input type="search" placeholder="Search" ng-model="filterName">
<ion-item class="item-remove-animate item-avatar item-icon-right" ng-repeat="leaf in leafs | filter:searchFilter" type="item-text-wrap" href="#/tab/leafs/{{leaf.id}}">
filter
$scope.searchFilter = function(obj) {
var re = new RegExp($scope.filterName, 'i');
return !$scope.filterName || re.test(obj.botanical_name) || re.test(obj.en_names) || re.test(obj.ml_names);
};
Check out the Ionic demo here: http://codepen.io/anon/pen/pjjGWo
Unfortunately, when I use console.log($scope.filterName)
, it appears empty. Any suggestions on how to resolve this issue?