我在文件夹app/pipes/safepipe
中有一个管道
如果我在app/home
中调用此管道,它将起作用。
请注意::我已经导入并在home.module.ts
中声明了它>
如果我没有在home page
上使用此管道,并尝试在以app/modals/viewdreportmodal
创建的页面中使用,则会出现错误
请注意::
我在modal page
上使用此home page
。The pipe 'safe2' could not be found (" <ion-text> {{daily_report_desc }} <span [innerHtml]="[ERROR ->]daily_report_desc | safe2: 'html'">{{daily_report_desc}}</span> </ion-text> <ion-text> "): ng:///HomePageModule/ViewdreportmodalPage.html@17:25
无法弄清楚为什么编译器无法在模式页面中识别出我的管道。
我在app / pipes / safepipe文件夹中有一个管道,如果我在app / home中称此管道,则它可以工作。请注意::我已经在home.module.ts中导入并声明了它,如果我不使用此管道,请尝试...
选项1-您必须在app.module.ts或app / modals内部的模块中导入管道。
您需要将管道添加到负责ViewdReportModalComponent
的模块中。