这个错误的意思是在 AppModule 中使用了 ApiService,而 ApiService 的构造函数中依赖了一个叫做 'String' 的服务,但是没有找到这个服务的提供者,所以出现了 NullInjectorError。可能是因为没有将 'String' 服务添加到 AppModule 的 providers 中。

Angular 错误:NullInjectorError: No provider for String! 解释及解决方法

原文地址: https://www.cveoy.top/t/topic/ofT5 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录