Closed
Description
🐞 Bug report
Command (mark with an x
)
- [X] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Is this a regression?
Not sureDescription
Expected behaviour:
When a new component is generated using ng g c someModule/newComponent
, it should be added to sub module.
Actual behaviour:
Newly generated component is added to root module instead of in sub module.
Scenario:
If i have a submodule called DeleteModule
app ===> delete ===> delete.module.ts
and if generate a component using ng g c delete/newComponent
. the newly generated components is added to DeleteModule. However if my DeleteModule's structure is
app => FeatureModule ===> delete ===> delete.module.ts
and i try to generate new component using ng g c FeatureModule/delete/someComponent
, thee newly generated component is added to root module instead of in sub module.
🔬 Minimal Reproduction
- Create a new angular project using ng new app.
- Create a sub module using
ng g m FeatureModule/delete
. - Create a component using
ng g c FeatureModule/delete/newComponent
.
🔥 Exception or Error
None
🌍 Your Environment
Defaults
Anything else relevant?
None