With ionic 3 pages can be lazy loaded using IonicPage
and IonicPageModule
. The problem is that these lazy loaded pages do not have access to pipes.
Failed to navigate: Template parse errors:
The pipe 'myPipe' could not be found ("")
This question describes the issue and provide a solution. My only concern with the proposed solution is that it requires importing the shared module pipes.module
in all lazy loaded pages.
Which kind of reverting back a nice feature introduced in angulr2 which is to import the pipe only one time in the app.module.ts
.
I think there should be a better way by importing the shared module pipes.module
in the app.module
so all the pipes will be visible to all pages.
Here is the app.module.ts
@NgModule({
declarations: [
MyApp,
],
imports: [
BrowserModule,
HttpModule,
PipesModule,
IonicModule.forRoot(MyApp),
IonicStorageModule.forRoot()
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
],
providers: []
})
export class AppModule { }
Should not we use
PipesModule.forRoot(MyApp)
To make the PipesModule
accessible to all lazy load pages?
Here is the pipes.moudle.ts
file:
@NgModule({
declarations: [
BreakLine,
Hashtag,
Translator
],
imports: [
],
exports: [
BreakLine,
Hashtag,
Translator
]
,
})
export class PipesModule {}