fix(angular): throw error when no parent module found (#16728)

This commit is contained in:
Colum Ferry 2023-05-03 16:39:54 +01:00 committed by GitHub
parent 6c221eae40
commit c2e88ad6a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,7 @@ function findModule(
tree: Tree,
generateDir: string,
projectRoot: string
): string | null {
): string {
let dir = generateDir;
const projectRootParent = dirname(projectRoot);
@ -80,5 +80,7 @@ function findModule(
dir = dirname(dir);
}
return null;
throw new Error(
"Could not find a candidate module to add the component to. Please specify which module the component should be added to by using the '--module' option."
);
}