I have made a simple edit to the standard tab app: my purpose is to filter data of the list.
I have edit the original markup with this code
<div class="list list-inset">
<label class="item item-input">
<i class="icon ion-ios7-search placeholder-icon"></i>
<input type="search" placeholder="Ricerca..." ng-model="searchQuery" />
<i class="clear-search icon ion-ios7-close-empty" ng-click="clearSearch()"></i>
</label>
</div>
and in the list i have add the filter as
<ion-item ng-repeat="friend in friends | filter: searchQuery" type="item-text-wrap" href="#/tab/friend/{{friend.id}}">
{{friend.name}}
</ion-item>
</ion-list>
In the controller i have add a simple function
.controller('FriendsCtrl', function($scope, Friends) {
$scope.friends = Friends.all();
//for reset filter
$scope.clearSearch = function() {
$scope.searchQuery = '';
};
})
but if the filter work fine, the clearSearch function don’t work: i have added a console.debug(‘ok’)… but the event don’t fire
Please excuse my poor english … and the very newbie question
Thank you in advance