No injector for custom defined data type的解决办法
生活随笔
收集整理的這篇文章主要介紹了
No injector for custom defined data type的解决办法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
“message”: "Can’t resolve all parameters for AppComponent in c:/Code/SPA/mystore/src/app/app.component.ts
‘DebugConfig’ only refers to a type, but is being used as a value here.
解決辦法
在app module里定義一個abstract class:
在NgModule的providers里定義這個injectable objects:
此時在Component里就可以注入DebugConfig了:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的No injector for custom defined data type的解决办法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 年度最佳:《塞尔达传说:王国之泪》M 站
- 下一篇: 网页中图片大小自动调整三种方法