Closed menelai closed 4 years ago
@menelai For clarification: if you use ngx-translate without the messageformat compiler (this library), everything's fine?
@menelai For clarification: if you use ngx-translate without the messageformat compiler (this library), everything's fine?
Yes, it is.
Creating factory for TranslateMessageFormatCompiler fix issue. MessageFormatConfig can be passed as param of constructor TranslateMessageFormatCompiler in factory function.
factory function:
export function TranslateMessageFormatCompilerFactory() {
return new TranslateMessageFormatCompiler();
}
module imports:
TranslateModule.forRoot({
compiler: {
provide: TranslateCompiler,
useFactory: TranslateMessageFormatCompilerFactory,
},
}),
@mlcit it works, thank you!
To reproduce: create new Ivy app:
Enable message compiler in app.module.ts:
Run
ng build --prod
, then open the app in browser and you will get an error in the console: