MCPcopy Create free account
hub / github.com/angular/angular / inject

Method inject

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

Source from the content-addressed store, hash-verified

415 ): T | null;
416 static inject<T>(token: ProviderToken<T>, notFoundValue?: T, options?: InjectOptions): T;
417 static inject<T>(
418 token: ProviderToken<T>,
419 notFoundValue?: T | null,
420 options?: InjectOptions,
421 ): T | null {
422 return TestBedImpl.INSTANCE.inject(token, notFoundValue, options);
423 }
424
425 /**
426 * Runs the given function in the `EnvironmentInjector` context of `TestBed`.

Callers 6

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

Calls 2

injectMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected