Angular Template parse errors: The pipe could not be found

16,313

Solution 1

I guess you should add TranslateModule to imports array of your AboutPageModule:

@NgModule({
  imports: [
    ...,
    TranslateModule
  ],
  declarations: [AboutPage],
  ...
})
export class AboutPageModule {}

If you have shared module then you can add this module there

@NgModule({
  ...,
  exports: [
    ...,
    TranslateModule
  ]
})
export class SharedModule {}

and after that the following should also work:

@NgModule({
  imports: [
    ...,
    SharedModule
  ],
  declarations: [AboutPage],
  ...
})
export class AboutPageModule {}

See also:

Solution 2

There are two things,

(i) you should import TranslateModule inside your submodules as well.

(ii) use HttpClientModule instead of HttpModule

import { HttpClient, HttpClientModule } from "@angular/common/http"

export function HttpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

Solution 3

Don't forget to export the Pipe in your TranslateModule

Share:
16,313
shah rushabh
Author by

shah rushabh

Updated on June 13, 2022

Comments