What is the best way to delete a component with CLI

后端 未结 14 1449
时光取名叫无心
时光取名叫无心 2020-12-22 18:35

I tried using \"ng destroy component foo\" and it tells me \"The destroy command is not supported by Angular-CLI\"

How do we properly delete components with Angular

14条回答
  •  感情败类
    2020-12-22 18:57

    Currently Angular CLI doesn't support an option to remove the component, you need to do it manually.

    1. Remove import references for every component from app.module
    2. Delete component folders.
    3. You also need to remove the component declaration from @NgModule declaration array in app.module.ts file

提交回复
热议问题