說明
Description
在編譯時,沒有找到針對某個建構函式引數的注入令牌。InjectionToken是可以在依賴注入提供者中使用的令牌。
There is no injection token for a constructor parameter at compile time. InjectionTokens are tokens that can be used in a Dependency Injection Provider.
在編譯時,沒有找到針對某個建構函式引數的注入令牌。InjectionToken是可以在依賴注入提供者中使用的令牌。
There is no injection token for a constructor parameter at compile time. InjectionTokens are tokens that can be used in a Dependency Injection Provider.
檢視引發錯誤的引數及其在該類別中的所有用法。用 string
,number
,boolean
和 Object
定義引數時,通常會引發此錯誤。
Look at the parameter that throws the error and all uses of the class. This error is commonly thrown when a constructor defines parameters with primitive types like string
, number
, boolean
, and Object
.
用來自 @angular/core
的 @Injectable
方法或 @Inject
裝飾器,以確保對你要注入的型別進行具體化(讓它具有執行期間表示形式)。確保將某個提供者新增到此裝飾器,以免丟擲NG0201:未找到提供者錯誤。
Use the @Injectable
method or @Inject
decorator from @angular/core
to ensure that the type you are injecting is reified (has a runtime representation). Make sure to add a provider to this decorator so that you do not throw NG0201: No Provider Found.