如何获取模板中管道数组的长度



示例代码:如果不使用管道,我可以通过获得数组长度

<my-component [arrLen]='arrayA.length'></my-component>

但是,如果我想通过管道获得过滤数组的长度,该怎么办?(下面不工作(

<my-component [arrLen]='arrayA | arrayFilterPipe:filterParam'></my-component>

如何做到这一点?感谢

替换您的代码

<my-component [arrLen]='arrayA | arrayFilterPipe:filterParam'></my-component>

<my-component [arrLen]='(arrayA | arrayFilterPipe:filterParam).length'></my-component>

最新更新