Skip to content

Commit

Permalink
refactor(core): allow nested array for ng-module scope info in local …
Browse files Browse the repository at this point in the history
…compilation mode

TODO
  • Loading branch information
pmvald committed Sep 4, 2023
1 parent 8a9eea3 commit df759ab
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/core/src/render3/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import {isForwardRef, resolveForwardRef} from '../di/forward_ref';
import {Type} from '../interface/type';
import {NgModule} from '../metadata';
import {flatten} from '../util/array_utils';
import {noSideEffects} from '../util/closure';
import {EMPTY_ARRAY} from '../util/empty';

Expand Down Expand Up @@ -66,10 +67,12 @@ function convertToTypeArray(values: FullAotScopeInfoFromDecorator|NgModule['decl
return values;
}

if (values.some(isForwardRef)) {
return () => values.map(resolveForwardRef).map(maybeUnwrapModuleWithProviders);
const flattenValues = flatten(values);

if (flattenValues.some(isForwardRef)) {
return () => flattenValues.map(resolveForwardRef).map(maybeUnwrapModuleWithProviders);
} else {
return values.map(maybeUnwrapModuleWithProviders);
return flattenValues.map(maybeUnwrapModuleWithProviders);
}
}

Expand Down

0 comments on commit df759ab

Please sign in to comment.