— Keep learning, keep building and keep growing :)

Ther is no easy way to rename an Angular component. There is no $ ng rename or $ ng move commands to rename components easily in the Angular CLI.

Some people have been asked for this as a CLI feature. See the issue  angular-cli#900 on GitHub for the discussion.

Renaming a component is not a common task I would do often. However, it can be a bit cumbersome when I have to.

With help from VSCode and some of the manual tasks, this is how I rename an Angular component. Maybe it’s not the best way but at least it works most of the time. And if you have a better solution, please let me know.

Note: This post is based on @angular/cli 8.2.2.

1. Use ‘Rename Symbol’ command

2. Save all files with Save All command

3. Rename folder and file names manually

7. Verify

#angular #javascript #components #rename

Renaming an Angular Component
4.50 GEEK