How to delete a component in Angular app
In this tutorial, we will learn how to delete a component in angular app which is generated using angular cli.
Note: There is no built-in command to delete a component in angular cli, we need to delete it manually.
Deleting the component
-
Open the angular app in your favorite code editor.
-
Navigate to the component folder and delete it.
-
Open your
app.module.ts
file and follow the below steps. -
Remove the component import statement.
-
Remove the component declaration from the
@Ngmodule
declarations array.