Skip to content

Newly created component not being added to submodule #13714

Closed
@ShadabFaiz

Description

@ShadabFaiz

🐞 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 sure

Description

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

  1. Create a new angular project using ng new app.
  2. Create a sub module using ng g m FeatureModule/delete.
  3. Create a component using ng g c FeatureModule/delete/newComponent.

🔥 Exception or Error

None

🌍 Your Environment


Defaults

Anything else relevant?
None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions