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
.
Save All
command#angular #javascript #components #rename