When building/serving angular-cli app (cli 1.4.4, angular 4.4.4) with AoT compilation enabled ($ ng serve --aot), there is a warning:
Warning: Can't resolve all parameters for TranslateMessageFormatCompiler in
/path/to/app/node_modules/ngx-translate-messageformat-compiler/src/translate-message-format-compiler.d.ts: (?).
This will become an error in Angular v5.x
Its probably connected to TranslateMessageFormatCompiler constructor definition.
I am using the service like this:
export function translateCompilerFactory() {
return new TranslateMessageFormatCompiler(new MessageFormat());
}
@NgModule({
imports: [
TranslateModule.forRoot({
compiler: {
provide: TranslateCompiler,
useFactory: translateCompilerFactory,
}
}),
],
})
export class AppModule { }
I did a little digging and found similar issues, looks like all you need to do to fix this is to remove @Injectable decorator from TranslateMessageFormatCompiler.
When building/serving angular-cli app (cli 1.4.4, angular 4.4.4) with AoT compilation enabled (
$ ng serve --aot
), there is a warning:Its probably connected to
TranslateMessageFormatCompiler
constructor definition.I am using the service like this: