ngx-toastr
ngx-toastr copied to clipboard
duplicated service when used in APP_INITIALIZER
Related to #328, there seems to be an issue with the creation of APP_INITIALIZERS, which depend on toastr. Here an example:
If you specify
{ provide: ConfigService, useClass: ConfigService, deps: [HttpBackend, ToastrService, TranslateService] },
{ provide: APP_INITIALIZER, useFactory: configServiceFactory, deps: [ConfigService], multi: true }
you end up in having ConfigService instantiated twice. I did some debugging and it seems, that by Toastr Overlay instantiation a new ConfigService is created, which is to taken up by AppModule instantiation.