(providers: StaticProvider[] = [])
| 170 | * This function is needed for bootstrapping a Standalone Component. |
| 171 | */ |
| 172 | export function createOrReusePlatformInjector(providers: StaticProvider[] = []): Injector { |
| 173 | // If a platform injector already exists, it means that the platform |
| 174 | // is already bootstrapped and no additional actions are required. |
| 175 | if (_platformInjector) return _platformInjector; |
| 176 | |
| 177 | publishDefaultGlobalUtils(); |
| 178 | if (typeof ngDevMode !== 'undefined' && ngDevMode) { |
| 179 | _unregisterAiTools = registerAiTools(); |
| 180 | } |
| 181 | |
| 182 | // Otherwise, setup a new platform injector and run platform initializers. |
| 183 | const injector = createPlatformInjector(providers); |
| 184 | |
| 185 | // During SSR, using this setting and using an injector from the global can cause the |
| 186 | // injector to be used for a different request due to concurrency. |
| 187 | if (typeof ngServerMode === 'undefined' || !ngServerMode) { |
| 188 | _platformInjector = injector; |
| 189 | } |
| 190 | |
| 191 | publishSignalConfiguration(); |
| 192 | runPlatformInitializers(injector); |
| 193 | return injector; |
| 194 | } |
| 195 | |
| 196 | /** |
| 197 | * @description |
no test coverage detected
searching dependent graphs…