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 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
26,545 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)
221,520 students enrolled
44 hours of video content
View Course
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
114,575 students enrolled
21 hours of video content
View Course