Akhtar Raza
Akhtar Raza

Reputation: 33

I'm getting this error, ERROR NullInjectorError: R3InjectorError(D)[Zs -> Zs]: NullInjectorError: No provider for Zs

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 wayerror image screenshot

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. My service code look like

Upvotes: 0

Views: 190

Answers (1)

Bajrang Singh
Bajrang Singh

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

Related Questions