Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newly created component not being added to submodule #13714

Closed
ShadabFaiz opened this issue Feb 19, 2019 · 1 comment · Fixed by #13720
Closed

Newly created component not being added to submodule #13714

ShadabFaiz opened this issue Feb 19, 2019 · 1 comment · Fixed by #13720
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@ShadabFaiz
Copy link

🐞 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

@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely area: schematics/angular labels Feb 20, 2019
@ngbot ngbot bot added this to the needsTriage milestone Feb 20, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Feb 20, 2019
kyliau pushed a commit that referenced this issue Feb 21, 2019
…ly different casing in name

At the moment users can have various casing and seperatirs in paths, we should not always dasherize the name when resolving modules.

As for example when providing something like:

```
/module/SubModule/feature
```

It won't be able to resolve the modules properly as `sub-module` does't exist.

This PR also updates the test for underscore as previously it was not properly testing this usercase, since the formatter was used on name and not th path.

Fixes #13714
kyliau pushed a commit that referenced this issue Feb 21, 2019
…ly different casing in name

At the moment users can have various casing and seperatirs in paths, we should not always dasherize the name when resolving modules.

As for example when providing something like:

```
/module/SubModule/feature
```

It won't be able to resolve the modules properly as `sub-module` does't exist.

This PR also updates the test for underscore as previously it was not properly testing this usercase, since the formatter was used on name and not th path.

Fixes #13714
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants