Skip to content

ng destroy component does not remove component from app.module.ts file #2299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Lasagna220 opened this issue Sep 22, 2016 · 8 comments
Closed

Comments

@Lasagna220
Copy link

  1. Operating System:
    Mac OSX 0.11.6 El Capitan
  2. Version:
    angular-cli: 1.0.0-beta.15
    node: 6.6.0
    os: darwin x64
  3. Steps to reproduce
    ng new new-app; cd new-app/src/app
    ng g component foo
    ng destroy component foo
    Notice that the src/app/app.module.ts file still has references to the foo component.
@vlgutv22
Copy link

Hey, Im have same issue but cant find any info(

@filipesilva
Copy link
Contributor

The ng destroy command isn't supported. It doesn't show in ng help anymore as well.

@mhdatie
Copy link

mhdatie commented Dec 11, 2016

@filipesilva What's the best way to destroy a generated component or directive then?

@mi60dev
Copy link

mi60dev commented Dec 18, 2016

+1
How do we delete components properly if not with ng destroy?

@filipesilva
Copy link
Contributor

In my experience the best way is to use git to figure out what was added. It's usually easy to figure out the new files, but not so easy to figure out the added imports.

We've talked about how generators maybe shouldn't auto-add the imports, but haven't decided if it's worth to change it.

@mhdatie
Copy link

mhdatie commented Dec 18, 2016

@filipesilva Maybe list the files edited on generating new components + the new files?

@filipesilva
Copy link
Contributor

That's a really good idea @MohamadAtieh. We list the created files but don't list the edited ones. I'll make an issue for it.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants