MCPcopy
hub / github.com/angular/angular / inject

Method inject

packages/core/testing/src/test_bed.ts:399–405  ·  view source on GitHub ↗
(
    token: ProviderToken<T>,
    notFoundValue?: T | null,
    options?: InjectOptions,
  )

Source from the content-addressed store, hash-verified

397 ): T | null;
398 static inject<T>(token: ProviderToken<T>, notFoundValue?: T, options?: InjectOptions): T;
399 static inject<T>(
400 token: ProviderToken<T>,
401 notFoundValue?: T | null,
402 options?: InjectOptions,
403 ): T | null {
404 return TestBedImpl.INSTANCE.inject(token, notFoundValue, options);
405 }
406
407 /**
408 * Runs the given function in the `EnvironmentInjector` context of `TestBed`.

Callers 5

runInInjectionContextMethod · 0.95
executeMethod · 0.95
createComponentMethod · 0.95
tearDownTestingModuleMethod · 0.95
tickMethod · 0.95

Calls 2

injectMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected