The filter on ng-repeat will only consider what is in the object. Not something that can be displayed while the loop is running. However, you can populate friends real data, and then the filter should work.
Using:
<ul> <li ng-repeat="friend in friends | injectItemTitles:'itemTitles' | filter:personFilter"> <span>{{friend.name}}</span> <span>{{friend.phone}}</span> <span>{{friend.itemTitles.join(', ')}}</span> </li> </ul>
Demo: http://jsbin.com/iciyoq/2/
There may be one problem with this approach, as it introduces item values ββinto each digest cycle. Therefore, it would be better to apply the injectItemTitles filter in the controller on large data sets.
Full code:
(function (app, ng) { 'use strict'; app.controller('MainCtrl', ['$scope', function($scope) { $scope.friends = [{ name: 'John', phone: '555-1276', items : ['id0', 'id1'] }, { name: 'Mary', phone: '800-BIG-MARY', items : ['id1', 'id2'] }, { name: 'Mike', phone: '555-4321', items : ['id2', 'id3'] }, { name: 'Adam', phone: '555-5678', items : ['id3', 'id4'] }, { name: 'Julie', phone: '555-8765', items : ['id4', 'id5'] }]; }]); app.filter('injectItemTitles', ['AllItems', 'getItemTitlesFilter', function(AllItems, getItemTitlesFilter) { return function(friends, prop){ return friends.map(function(friend) { friend[prop] = getItemTitlesFilter(friend.items); return friend; }); }; }]); app.filter('getItemTitles', ['AllItems', function(AllItems){ return function(items){ return items.map(function (id) { return AllItems[id]; }); }; }]); app.service('AllItems', function(){ return { 'id0' : 'aaa', 'id1' : 'aab', 'id2' : 'aba', 'id3' : 'abb', 'id4' : 'baa', 'id5' : 'bab', 'id6' : 'bba', 'id7' : 'bbb' }; }); }(angular.module('app', []), angular));