Reputation: 33
I added all services to my app module provider and All services have this
@Injectable({ providedIn: "root", })
But still, I'm getting this error. I tried all the way
ERROR NullInjectorError: R3InjectorError(D)[Zs -> Zs]: NullInjectorError: No provider for Zs!
My app module code
providers: [
{
provide: LocationStrategy,
useClass: HashLocationStrategy
},
{
provide: HTTP_INTERCEPTORS,
useClass: HttpConfigInterceptor,
multi: true
},
],
My service code look like this.
Upvotes: 0
Views: 190
Reputation: 11
Run your application in dev mode, you would you be able to find exact dependency to inject in providers - add following code in to angular.json under configurations "development": { "optimization": false, "outputHashing": "all", "sourceMap": false, "namedChunks": false, "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true },
to run code in dev mode.
Upvotes: 1