fix(angular): throw error when no parent module found (#16728)
This commit is contained in:
parent
6c221eae40
commit
c2e88ad6a7
@ -56,7 +56,7 @@ function findModule(
|
|||||||
tree: Tree,
|
tree: Tree,
|
||||||
generateDir: string,
|
generateDir: string,
|
||||||
projectRoot: string
|
projectRoot: string
|
||||||
): string | null {
|
): string {
|
||||||
let dir = generateDir;
|
let dir = generateDir;
|
||||||
const projectRootParent = dirname(projectRoot);
|
const projectRootParent = dirname(projectRoot);
|
||||||
|
|
||||||
@ -80,5 +80,7 @@ function findModule(
|
|||||||
dir = dirname(dir);
|
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."
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user