* Add either request or transient globally scoped enhancers * to all controllers metadata storage
()
| 642 | * to all controllers metadata storage |
| 643 | */ |
| 644 | public addScopedEnhancersMetadata() { |
| 645 | iterate(this.applicationProvidersApplyMap) |
| 646 | .filter(wrapper => this.isRequestOrTransient(wrapper.scope!)) |
| 647 | .forEach(({ moduleKey, providerKey }) => { |
| 648 | const modulesContainer = this.container.getModules(); |
| 649 | const { injectables } = modulesContainer.get(moduleKey)!; |
| 650 | const instanceWrapper = injectables.get(providerKey); |
| 651 | |
| 652 | const iterableIterator = modulesContainer.values(); |
| 653 | iterate(iterableIterator) |
| 654 | .map(moduleRef => |
| 655 | Array.from<InstanceWrapper>(moduleRef.controllers.values()).concat( |
| 656 | moduleRef.entryProviders, |
| 657 | ), |
| 658 | ) |
| 659 | .flatten() |
| 660 | .forEach(controllerOrEntryProvider => |
| 661 | controllerOrEntryProvider.addEnhancerMetadata(instanceWrapper!), |
| 662 | ); |
| 663 | }); |
| 664 | } |
| 665 | |
| 666 | public applyApplicationProviders() { |
| 667 | const applyProvidersMap = this.getApplyProvidersMap(); |
no test coverage detected