Skip to content

Commit

Permalink
Merge pull request #24798 from storybookjs/valentin/angular-component…
Browse files Browse the repository at this point in the history
…-part-of-two-declarations

Angular: Handle nested module metadata
  • Loading branch information
valentinpalkovic authored Nov 10, 2023
2 parents 0c2953f + f16de2f commit 4f6ac8d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const isComponentAlreadyDeclared = (
): boolean => {
if (
moduleDeclarations &&
moduleDeclarations.some((declaration) => declaration === componentToFind)
moduleDeclarations.flat().some((declaration) => declaration === componentToFind)
) {
// Found component in declarations array
return true;
Expand All @@ -23,7 +23,7 @@ export const isComponentAlreadyDeclared = (
return false;
}

return moduleImports.some((importItem) => {
return moduleImports.flat().some((importItem) => {
const extractedNgModuleMetadata = extractNgModuleMetadata(importItem);
if (!extractedNgModuleMetadata) {
// Not an NgModule
Expand Down

0 comments on commit 4f6ac8d

Please sign in to comment.