I have something like this:
@NgModule({
imports: [ BrowserModule ],
declarations: [ LoaderComponent ],
bootstrap: [ LoaderComponent ],
})
export class AppModule {
constructor( private params : BootstrapParams ) {
}
}
export class BootstrapParams {
public urlParam : String;
constructor(screenUrl : String) {
this.urlParam = screenUrl
}
}
and from my main.ts I have:
export function main(screenUrl) {
platformBrowserDynamic().bootstrapModule(AppModule, {providers: [ { provide : BootstrapParams, useFactory: () => new BootstrapParams("/bla/bla") }]});
}
But this is throwing
"Can't resolve all parameters for AppModule: (?).(…)"
and I do not understand what I am doing wrong, I have read all the documentation, but there are not many example of passing data to the root module.