我有下面的阵列显示,
$ scope.selectionCat = [ '1', '3', '4']
在HTML正在呼叫等
< DIV DIR-PAGINATE = “在项目项| filterForCat:这个” >
自定义过滤器
.filter('filterForCat', function() {
return function (item, scope) {
return (scope.selectionCat.indexOf(item.category_id.id) !== -1);
};
})
当我试图read'scope.selectionC在'值得到错误'不能读取属性'ID'未定义'
我可以得到任何帮助来解决这个问题吗?
'category_id'是不确定的。你是否证实它存在于'item'上? –
是的,我已经验证..当我安慰它获取对象数组.. – Raghav
在模板中没有'this'这样的事情。不要通过范围。通过选择卡。 –