I added a filter function to the controller:
JS:
angular.module('myApp', []) .controller('myController', ['$scope', function($scope) { $scope.friends = [{ name: 'John', phone: '555-1276', a: [1, 2, 3] }, { name: 'Mary', phone: '800-BIG-MARY', a: [1, 2, 3] }, { name: 'Mike', phone: '555-4321', a: null }, { name: 'Adam', phone: '555-5678', a: [] }, { name: 'Julie', phone: '555-8765', a: [] }, { name: 'Juliette', phone: '555-5678', a: [] }]; $scope.filterFn = function(item) {
In your template:
<table> <tr><th>Name</th><th>Phone</th><th>array len</th></tr> <tr ng-repeat="friend in friends | filter: filterFn"> <td>{{friend.name}}</td> <td>{{friend.phone}}</td> <td>{{friend.a.length}}</td> </tr> </table>
Changed by Angular Filter doc plnkr
source share