I am trying to display some data using ng-repeat . I want to have a filter on the displayed data, and when I click on a specific item, the filter must be removed. When I click on this particular item again, the filter should be added again.
I started with an idea, in my opinion, I have:
<ion-item class="row" ng-repeat="t in tickets"> <div class="col" ng-click="toggleFilter(t.name)">{{t.name}}</div> </ion-item>
In my controller:
.controller('TicketCtrl', function ($scope, $filter) { $scope.toggleFilter = function (name) { name = $filter('getSlice')(name); alert(name); } });
When I warn name , it gives the correct filtered item, but it is not updated in the view. I think this should do something with the ng-repeat child scope, but I don't know how to do this with filter switching.
Does anyone have any suggestions or solutions to solve this problem?
source share