angular ng-repeat and filter in the controller
Demo of $filter service usage in the controller, click on the item to hide it from the list and update records count
HTML
<div ng-app="MyApp">
<h3>The list (click on the item to hide it and update records count):</h3>
<div ng-controller="ListCtrl as ctrl">
<ul>
<li ng-repeat="person in ctrl.people as filteredSolutions" ng-click="ctrl.hide(person)">
{{person.name}}: {{person.phone}}
W{{$index + 1}}
</li>
</ul>
<div>
Records count: {{ctrl.people.length}}
</div>
</div>
</div>
JavaScript
var people = [
{"name": "Jen", "phone": "22-11-11", "visible": true},
{"name": "Bob", "phone": "33-22-44", "visible": true},
{"name": "Ken", "phone": "11-22-33", "visible": true},
{"name": "Lisa", "phone": "77-88-99", "visible": true}
];
var app = angular.module('MyApp', []);
app.controller('ListCtrl', ['$scope', '$filter', function ($scope, $filter) {
var self = this;
this.hide = function(item) {
item.visible = false;
self.refresh();
};
this.refresh = function() {
self.people = $filter('filter')(people, {visible: true});
};
this.refresh();
}]);