I have this collection of courses:
[{ id: 1, courseId: 2, text: 'John' },
{ id: 2, courseId: 2, text: 'Willi' },
{ id: 3, courseId: 2, text: 'Inga' },
{ id: 4, courseId: 1, text: 'Jerry' },
{ id: 5, courseId: 1, text: 'Michael' },
{ id: 1, courseId: 3, text: 'John' },
{ id: 2, courseId: 3, text: 'Willi' },
{ id: 3, courseId: 4, text: 'Inga' },
{ id: 4, courseId: 5, text: 'Jerry' },
{ id: 5, courseId: 5, text: 'Michael' }]
And I have this array of id's:
[{"id": 3},{"id": 2},{"id": 1}]
I need to filter array of courses by array of id's(i.e to display only text courses that have courseId = 3,2,1 ):
ng-repeat="course in courses| customFilter: [{"id": 3},{"id": 2},{"id": 1}]"
I need to create custom filter in angularJS that will filter array of courses by array of id's.
Any idea how can I implement customFilter for this purpose?


