This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Description
Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Area
- [ ] devkit
- [x] schematics
Versions
Node v8.9.0
Npm 5.6.0
Windows 10
Repro steps
Let's say I have the following structure -
app/
app.module.ts
custom-app/
app.module.ts
And I want to create a new component under custom-app
From the root of the project, trying to run any of these :
ng g c my-comp -m="../custom-app/app.module.ts"
or
ng g c custom-app/my-comp -m="../custom-app/app.module.ts"
or even
ng g c /src/custom-app/my-comp -m="../custom-app/app.module.ts"
results in a component being created under the /app folder and not /custom-app.
The log given by the failure
create src/app/custom-app/my-comp/my-comp.component.html (26 bytes)
create src/app/custom-app/my-comp/my-comp.component.spec.ts (629 bytes)
create src/app/custom-app/my-comp/my-comp.component.ts (271 bytes)
create src/app/custom-app/my-comp/my-comp.component.css (0 bytes)
update src/custom-app/app.module.ts (419 bytes)
Desired functionality
I would expect that -
-
Specifying a module would create the component underneath that specific module's folder
-
If not, at least specifying a different path (starting from the src folder) will generate that component under that custom path
Mention any other details that might be useful
none