-
Notifications
You must be signed in to change notification settings - Fork 12k
"ng destroy component" doesn't remove the "import" statement from "app.module.ts", nor does it remove the component from the declarations array #1788
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
Comments
We don't really support destroying generated stuff, it's a remnant from |
It seems to me that if the automated inclusion routine edits a given file, the automation removal routine should remove the edits on that same file. Either that, or the deletion routine should be scrapped. Inconsistent behavior will likely lead to confusion and not convenience. |
@filipesilva why not add support ng destroy ? it's realy helpfull and it works just import from *.module.ts doesn't removed, will be nice to get a look here |
It's more than just removing imports. There's usually more code than that added, and users might have modified it further after the generator did it's job. So we can't determine well what should be removed. |
ok then you can destroy only if you create by error without and modification, as me 5min ago. I just created and directly ng destroy c header ... by this way only import doesn't work ! but anyway this is "nice to have feature" better perform angular-cli command because it's a little slow right now, thanks for reply |
I agree, it's a pain in the ass when you create the component with an error in the name and just want to immediately delete... |
100% agree. I just created a test component for testing using All I want to do is go remove one of the duplicates in an automated way so that I can keep clean organization going forward. |
100% agree too. It would be really helpful to have a command to destroy components, so we can delete them keeping the code clean |
I would like to see this feature in future !!! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When generating a component, the CLI makes necessary changes to "app.module.ts".
I would expect that destroying a component should accomplish the opposite (remove files, remove that import statement and also remove that component from the declarations array on the @NgModule decorator).
The text was updated successfully, but these errors were encountered: