MCPcopy Index your code
hub / github.com/angular/angular / platformServer

Function platformServer

packages/platform-server/src/server.ts:130–149  ·  view source on GitHub ↗
(extraProviders?: StaticProvider[] | undefined)

Source from the content-addressed store, hash-verified

128 * @publicApi
129 */
130export function platformServer(extraProviders?: StaticProvider[] | undefined): PlatformRef {
131 const noServerModeSet = typeof ngServerMode === 'undefined';
132 if (noServerModeSet) {
133 globalThis['ngServerMode'] = true;
134 }
135
136 const platform = createPlatformFactory(
137 platformCore,
138 'server',
139 INTERNAL_SERVER_PLATFORM_PROVIDERS,
140 )(extraProviders);
141
142 if (noServerModeSet) {
143 platform.onDestroy(() => {
144 globalThis['ngServerMode'] = undefined;
145 });
146 }
147
148 return platform;
149}

Callers 3

createServerPlatformFunction · 0.90

Calls 2

createPlatformFactoryFunction · 0.90
onDestroyMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…