(injector: Injector)
| 36 | * @publicApi |
| 37 | */ |
| 38 | export function createPlatform(injector: Injector): PlatformRef { |
| 39 | if (getPlatform()) { |
| 40 | throw new RuntimeError( |
| 41 | RuntimeErrorCode.MULTIPLE_PLATFORMS, |
| 42 | ngDevMode && 'There can be only one platform. Destroy the previous one to create a new one.', |
| 43 | ); |
| 44 | } |
| 45 | |
| 46 | publishDefaultGlobalUtils(); |
| 47 | publishSignalConfiguration(); |
| 48 | if (typeof ngDevMode !== 'undefined' && ngDevMode) { |
| 49 | _unregisterAiTools = registerAiTools(); |
| 50 | } |
| 51 | |
| 52 | // During SSR, using this setting and using an injector from the global can cause the |
| 53 | // injector to be used for a different requjest due to concurrency. |
| 54 | _platformInjector = typeof ngServerMode === 'undefined' || !ngServerMode ? injector : null; |
| 55 | |
| 56 | const platform = injector.get(PlatformRef); |
| 57 | runPlatformInitializers(injector); |
| 58 | return platform; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Creates a factory for a platform. Can be used to provide or override `Providers` specific to |
no test coverage detected
searching dependent graphs…