i have an shared module with an resource service in it. In my app.module i want to import this module and init the resource service with values. So my components defined in share.module can use the resources (translations).
P.S. I don't want to init the resource service within providers of app.module. The share module should be self-contained.
share.module.ts
@NgModule({
declarations: [ ComponentA, ComponentB],
providers: [ResourceService], ...
app.module.ts
import [ ShareModule ]
app.component.ts
ngOnInit()
{
this.http.get("resource").subscribe(resource => {
// init resource service of share module here
}
}
Can you please tell me how i can achieve it?
Best regards