Angular报错NullInjectorError:找不到Zs的提供者,求解决
Angular依赖注入错误:NullInjectorError: No provider for Zs!
遇到如下错误:ERROR NullInjectorError: R3InjectorError(D)[Zs -> Zs]: NullInjectorError: No provider for Zs!
已将所有服务添加到AppModule的providers中,且所有服务均配置@Injectable({ providedIn: "root", }),但仍报错,尝试多种方法无果。
错误截图:
AppModule代码片段:
providers: [ { provide: LocationStrategy, useClass: HashLocationStrategy }, { provide: HTTP_INTERCEPTORS, useClass: HttpConfigInterceptor, multi: true },
服务代码截图:
内容的提问来源于stack exchange,提问作者Akhtar Raza
相关产品推荐
相关产品推荐

