Angular 角度2:管道在嵌套构件中不工作
我的定制管道一直工作,直到我为它自己的组件制作了ngFor列表 这项工作:Angular 角度2:管道在嵌套构件中不工作,angular,Angular,我的定制管道一直工作,直到我为它自己的组件制作了ngFor列表 这项工作: <div> <ul *ngFor="let item of items | myPipe : 'someString'"> {{item}} </ul> </div> 对特定项目使用自定义管道,而不是对列表中的所有值使用自定义管道。在无序列表中,不能使用管道,只能使用管道作为列表 <div> <ul *ngFor="let item
<div>
<ul *ngFor="let item of items | myPipe : 'someString'">
{{item}}
</ul>
</div>
对特定项目使用自定义管道,而不是对列表中的所有值使用自定义管道。在无序列表中,不能使用管道,只能使用管道作为列表
<div>
<ul *ngFor="let item of items">
<li>{{item | myPipe : 'someString'}}</li>
</ul>
</div>
{{item | myPipe:'someString'}}
在无序列表中,它确实可以正常工作。问题是,当我将列表移动到它自己的组件中时,它停止工作。为什么不能使用(或)
zone.js:516 Unhandled Promise rejection: Template parse errors:
The pipe 'myPipe' could not be found
<div>
<ul *ngFor="let item of items">
<li>{{item | myPipe : 'someString'}}</li>
</ul>
</div>