我的情况是这样,我要动态加载组件C1,然后C1里有子组件C2、C3。而C2、C3同时使用了管道P1。
当C2和C3同时declarations: [XXComponent, P1Pipe]时报错:
Type P1Pipe is part of the declarations of 2 modules: C2Module and C3Module! Please consider moving P1Pipe to a higher module that imports C2Module and C3Module. You can also create a new NgModule that exports and includes P1Pipe then import that NgModule C2Module and C3Module
而把P1Pipe移到C1的declarations中之后又报错:
The pipe 'p1' could not be found
请问到底怎么样才可以实现