MCPcopy
hub / github.com/angular/angular / injectorFactory

Function injectorFactory

packages/common/upgrade/test/upgrade.spec.ts:29–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29export function injectorFactory() {
30 const rootScopeMock = new $rootScopeMock();
31 const rootElementMock = {on: () => undefined};
32 return function $injectorGet(provider: string) {
33 if (provider === '$rootScope') {
34 return rootScopeMock;
35 } else if (provider === '$rootElement') {
36 return rootElementMock;
37 } else {
38 throw new Error(`Unsupported injectable mock: ${provider}`);
39 }
40 };
41}
42
43export class $rootScopeMock {
44 private watchers: any[] = [];

Callers 1

upgrade.spec.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…