@internal
()
| 424 | |
| 425 | /** @internal */ |
| 426 | resolveInjectorInitializers() { |
| 427 | const prevConsumer = setActiveConsumer(null); |
| 428 | const previousInjector = setCurrentInjector(this); |
| 429 | const previousInjectImplementation = setInjectImplementation(undefined); |
| 430 | let prevInjectContext: InjectorProfilerContext | undefined; |
| 431 | if (ngDevMode) { |
| 432 | prevInjectContext = setInjectorProfilerContext({injector: this, token: null}); |
| 433 | } |
| 434 | |
| 435 | try { |
| 436 | const initializers = this.get(ENVIRONMENT_INITIALIZER, EMPTY_ARRAY, {self: true}); |
| 437 | if (ngDevMode && !Array.isArray(initializers)) { |
| 438 | throw new RuntimeError( |
| 439 | RuntimeErrorCode.INVALID_MULTI_PROVIDER, |
| 440 | 'Unexpected type of the `ENVIRONMENT_INITIALIZER` token value ' + |
| 441 | `(expected an array, but got ${typeof initializers}). ` + |
| 442 | 'Please check that the `ENVIRONMENT_INITIALIZER` token is configured as a ' + |
| 443 | '`multi: true` provider.', |
| 444 | ); |
| 445 | } |
| 446 | for (const initializer of initializers) { |
| 447 | initializer(); |
| 448 | } |
| 449 | } finally { |
| 450 | setCurrentInjector(previousInjector); |
| 451 | setInjectImplementation(previousInjectImplementation); |
| 452 | ngDevMode && setInjectorProfilerContext(prevInjectContext!); |
| 453 | setActiveConsumer(prevConsumer); |
| 454 | } |
| 455 | } |
| 456 | |
| 457 | override toString() { |
| 458 | if (ngDevMode) { |
no test coverage detected