Closed NgxDev closed 8 years ago
We don't really support destroying generated stuff, it's a remnant from ember-cli
functionality. We'll try to remove it from ng help
in https://github.com/angular/angular-cli/issues/1807.
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 $ ng g component chartJS-charts I did not pay attention to when it saved as chart-js-charts. I then immediately created a new component using $ ng g component chartJS-charts/bar-charts This created a new fileless component actually titled chartJS-charts with a child/sub component titled bar-charts.
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. 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.
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).