Open r0manchak opened 7 years ago
I have a special service responsible for handling all the http requests going from my application. It's injected in app.module file (root module) as following
{provide: ErrorHandler, useClass: CustomErrorHandler}
I also have a SharedModule which contains many other components and is imported by almost all of my modules.
SharedModule
The problem is when I import Ng2CompleterModule into my SharedModule my HttpClientService is no more used for request processing.
Ng2CompleterModule
HttpClientService
I suppose the problem has something in common with #296 but not sure about this. I don't use HttpClient.
HttpClient
Maybe this part of my package.json will be useful.
package.json
"@angular/compiler": "^4.4.0-RC.0", "@angular/core": "^4.4.0-RC.0", "@angular/forms": "^4.4.0-RC.0", "@angular/http": "^4.4.0-RC.0", "ng2-completer": "^1.6.3",
PS. When I copy this line {provide: ErrorHandler, useClass: CustomErrorHandler} to my shared.module file the service is injected twice.
shared.module
That means multiple modules have multiple instances of the service.
Using useExisting doesn't help. It throws Provider not found exception.
useExisting
Provider not found
try using version 2 it no longer uses HttpClient
Yes, thank you, that's what I did yesterday. The bug disappeared
I have a special service responsible for handling all the http requests going from my application. It's injected in app.module file (root module) as following
{provide: ErrorHandler, useClass: CustomErrorHandler}
I also have a
SharedModule
which contains many other components and is imported by almost all of my modules.The problem is when I import
Ng2CompleterModule
into mySharedModule
myHttpClientService
is no more used for request processing.I suppose the problem has something in common with #296 but not sure about this. I don't use
HttpClient
.Maybe this part of my
package.json
will be useful.PS. When I copy this line
{provide: ErrorHandler, useClass: CustomErrorHandler}
to myshared.module
file the service is injected twice.That means multiple modules have multiple instances of the service.
Using
useExisting
doesn't help. It throwsProvider not found
exception.