I am working on angular2 for my new project, newly with this technology. I have set-up my project with angular CLI (Reference site https://github.com/angular/angular-cli). I have created 4 components using command ng generate component my-new-component
For testing purpose, created one component app-testing, need to remove that component from my project. Else need to rename for that component. I have tried several like. ng destroy component app-testing
but showing error The destroy command is not supported by Angular-CLI., Please help me with solution. Thanks in advance.
Steps to remove undesired component from the App In this example we will go to the path fullApp\Ionic5FullApp\src\app\pages\layouts and delete the corresponding folder 'uber-map-flow'. Similarly you have to search for the folder of the page that you want to remove and then just simply go and delete it.
I had the same problems and it seems that they removed the destroy command from the CLI and you need to do it manually by deleting or renaming the according folders/files and imports, which is really a laborious task.
https://github.com/angular/angular-cli/issues/900 https://github.com/angular/angular-cli/issues/1788
You can delete any component by removing all its lines from app.module.ts . Its working fine for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With