Is there a way to access a service inside the load module in Angular, especially when the module is loaded from a decorator and the service is not yet DI?
You can refer to this answer for an example.
For instance, if the method in the service returns an Observable, the config would look like this:
export interface TranslateConfig {
someProp?: string;
anotherProp?: string;
observableProp?: Observable<string>
}
When loading the module in app.module.ts:
@NgModule({
imports: [
TranslateModule.forRoot({
someProp: someValue,
anotherProp: anotherValue,
observableProp: (method from service)
})
]
})
export class AppModule{
...
}
The goal is to make use of the service within the decorator.