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

Function inject

packages/core/testing/src/test_bed.ts:947–953  ·  view source on GitHub ↗
(tokens: any[], fn: Function)

Source from the content-addressed store, hash-verified

945 * @publicApi
946 */
947export function inject(tokens: any[], fn: Function): () => any {
948 const testBed = TestBedImpl.INSTANCE;
949 // Not using an arrow function to preserve context passed from call site
950 return function (this: unknown) {
951 return testBed.execute(tokens, fn, this);
952 };
953}
954
955/**
956 * @publicApi

Calls 1

executeMethod · 0.65

Tested by 15

constructorMethod · 0.72
constructorMethod · 0.72
constructorMethod · 0.72
constructorMethod · 0.72
constructorMethod · 0.72
isLoggedInGuardFunction · 0.72
createLoggerGuardFunction · 0.72
constructorMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…