MCPcopy
hub / github.com/angular/angular / runInInjectionContext

Method runInInjectionContext

packages/core/testing/src/test_bed.ts:412–414  ·  view source on GitHub ↗

* Runs the given function in the `EnvironmentInjector` context of `TestBed`. * * @see https://angular.dev/api/core/EnvironmentInjector#runInContext

(fn: () => T)

Source from the content-addressed store, hash-verified

410 * @see {@link https://angular.dev/api/core/EnvironmentInjector#runInContext}
411 */
412 static runInInjectionContext<T>(fn: () => T): T {
413 return TestBedImpl.INSTANCE.runInInjectionContext(fn);
414 }
415
416 static createComponent<T>(
417 component: Type<T>,

Callers 1

initComponentMethod · 0.95

Calls 3

injectMethod · 0.95
runInInjectionContextFunction · 0.90
runInInjectionContextMethod · 0.65

Tested by

no test coverage detected