Closed alonstar closed 6 years ago
Yeah, I messed that up, sorry. I'm beginning to think that passing non-injectable arguments to a provider's constructor is problematic. I'll have to investigate. For now you can use the factory function but not pass a config object:
export function TranslateMessageFormatCompilerFactory() {
return new TranslateMessageFormatCompiler();
}
@NgModule({
// ...
imports: [
// ...
TranslateModule.forRoot({
compiler: {
provide: TranslateCompiler,
useFactory: TranslateMessageFormatCompilerFactory
}
})
]
})
I've unpublished v2.2.0 for now to prevent more people from running into this.
I updated to last version and get this error
and the app.modules.ts
but useFactory: TranslateMessageFormatCompilerFactory it works. If I want to use useClass, What should I do?