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

Directive generated from project root directory is added to wrong module #12614

Closed
tchatel opened this issue Oct 16, 2018 · 1 comment · Fixed by #12615
Closed

Directive generated from project root directory is added to wrong module #12614

tchatel opened this issue Oct 16, 2018 · 1 comment · Fixed by #12615
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity5: regression
Milestone

Comments

@tchatel
Copy link

tchatel commented Oct 16, 2018

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

It's a regression which occurs since Angular CLI version 6.0.0 (and still occurs with latest versions 6.2.5 and 7.0.0-rc.3).
There was no problem with Angular CLI 1.7.4 / Angular 5.

Repro steps

ng new proj
cd proj
ng generate module mod
ng generate directive mod/dir

The log given by the failure

CREATE src/app/mod/dir.directive.spec.ts (212 bytes)
CREATE src/app/mod/dir.directive.ts (135 bytes)
[BUG]>> UPDATE src/app/app.module.ts (384 bytes)

Desired functionality

The directive should be added to src/app/mod/mod.module.ts, not to src/app/app.module.ts.

No problem when generating pipes and components. The bug only happens with directives, and when the command is run from the project root directory. When the command is run from the target module directory, it's ok.

@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 8, 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 severity5: regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants