diff --git a/packages/schematics/angular/utility/ast-utils.ts b/packages/schematics/angular/utility/ast-utils.ts index 8861380abf78..855160cd53d1 100644 --- a/packages/schematics/angular/utility/ast-utils.ts +++ b/packages/schematics/angular/utility/ast-utils.ts @@ -132,7 +132,7 @@ export function findNodes( } if (max > 0 && (recursive || !test(node))) { for (const child of node.getChildren()) { - findNodes(child, test, max).forEach((node) => { + findNodes(child, test, max, recursive).forEach((node) => { if (max > 0) { arr.push(node); }