by Sai gowtham

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

  1. Open the angular app in your favorite code editor.
  2. Navigate to the component folder and delete it.
  3. Open your app.module.ts file and follow the below steps.
  4. Remove the component import statement.
  5. Remove the component declaration from the @Ngmodule declarations array.

Top Udemy Courses

JavaScript - The Complete Guide 2021 (Beginner + Advanced)
JavaScript - The Complete Guide 2021 (Beginner + Advanced)
64,026 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
152,857 students enrolled
48.5 hours of video content
View Course