MCPcopy
hub / github.com/angular/angular / createPlatformInjector

Function createPlatformInjector

packages/core/src/platform/platform.ts:101–110  ·  view source on GitHub ↗

* Helper function to create an instance of a platform injector (that maintains the 'platform' * scope).

(providers: StaticProvider[] = [], name?: string)

Source from the content-addressed store, hash-verified

99 * scope).
100 */
101function createPlatformInjector(providers: StaticProvider[] = [], name?: string): Injector {
102 return Injector.create({
103 name,
104 providers: [
105 {provide: INJECTOR_SCOPE, useValue: 'platform'},
106 {provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => (_platformInjector = null)])},
107 ...providers,
108 ],
109 });
110}
111
112/**
113 * Checks that there is currently a platform that contains the given token as a provider.

Callers 2

createPlatformFactoryFunction · 0.70

Calls 1

createMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…