填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫Home

InjectFlags

DI 的注入標誌。

Injection flags for DI.

      
      enum InjectFlags {
  Default: 0b0000
  Host: 0b0001
  Self: 0b0010
  SkipSelf: 0b0100
  Optional: 0b1000
}
    

成員列表

成員說明
Default: 0b0000

檢查自身並檢查父注入器(如果需要)

Check self and check parent injector if needed

Host: 0b0001

指定注入器應從任何注入器中檢索依賴項,直到到達當前元件的宿主元素為止。(僅與元素注入器一起使用)

Specifies that an injector should retrieve a dependency from any injector until reaching the host element of the current component. (Only used with Element Injector)

Self: 0b0010

不要上升到請求注入的節點的祖先去處理。

Don't ascend to ancestors of the node requesting injection.

SkipSelf: 0b0100

跳過請求注入的節點。

Skip the node that is requesting injection.

Optional: 0b1000

如果找不到令牌,則注入 defaultValue

Inject defaultValue instead if token not found.