I have an array show below,
$scope.selectionCat = ['1','3','4']
In HTML am calling like
<div dir-paginate="item in items | filterForCat:this">
Custom filter
.filter('filterForCat', function () {
return function (item, scope) {
return (scope.selectionCat.indexOf(item.category_id.id) !== -1);
};
})
When am trying to read'scope.selectionCat' values am getting error like 'Cannot read property 'id' of undefined'
Can i get any help to solve this?
category_idis undefined. Have you verified that it exists onitem?thisin a template. Don't pass the scope. Pass selectionCat.