To remove components created with Angular CLI, follow these steps:
1. Manually Delete Component Files
Navigate to the component folder and delete it:
rm -r src/app/component-name/
(For Windows: Use del /s /q or delete manually in File Explorer)
2. Remove Component References
Delete the component import and declaration from app.module.ts or any feature module.
Example:
import { ComponentNameComponent } from './component-name/component-name.component';
Remove this line and the reference in @NgModule declarations.
3. Remove Component Usage
Check HTML templates and routes to remove any <app-component-name> references.