Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove components created with Angular-CLI [duplicate]

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.

like image 450
kishan kurivella Avatar asked Jan 04 '17 09:01

kishan kurivella


People also ask

How do you delete an ionic component?

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.


2 Answers

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

like image 121
Carsten H Avatar answered Oct 06 '22 01:10

Carsten H


You can delete any component by removing all its lines from app.module.ts . Its working fine for me.

like image 29
sumit gupta Avatar answered Oct 06 '22 00:10

sumit gupta