I have just upgraded to Ionic 3.0.1
so I can use LazyLoading
, and since that I can\'t use my custom Pipes
:
import {
so I fixed this issue by making a PipesModule
where I import my custom Pipes
into, then import it in the page module.ts
that I wanna use it on
import { NgModule } from '@angular/core';
import { StripHTML } from './strip-html';
@NgModule({
declarations: [
StripHTML,
],
imports: [
],
exports: [
StripHTML
]
})
export class PipesModule { }
and then in the page | HomePage
as an example:
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { Home } from './home';
import { PipesModule } from '../../pipes/pipes.module';
@NgModule({
declarations: [
Home,
],
imports: [
IonicPageModule.forChild(Home),
PipesModule
],
exports: [
Home
]
})
export class HomeModule { }
and it did work fine , not sure if this is the correct way or not , but it worked fine, please let me know if there is a better way... thanks!
What you need to do is just import the PipesModule(line 12 in below snippet) in to your every page.module.ts (i.e. home.moodule.ts) file....
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { LoginPage } from './login';
import { PipesModule } from '../../pipes/pipes.module';
@NgModule({
declarations: [
LoginPage,
],
imports: [
IonicPageModule.forChild(LoginPage),
PipesModule
]
})
export class LoginPageModule { }
This worked for me.