Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename Service created by @Angular/cli using command

I created a service team-secret.service using command n g s team-secret But now I want to rename it team.service using command.

Any help would be appreciated.

like image 225
ricky Avatar asked May 10 '17 09:05

ricky


People also ask

Can I rename a component in angular?

Use 'Rename Symbol' command With the cursor at the Component class, open Command Palette in VSCode with cmd+shift+p . Select “Rename Symbol” command and change the class name. VSCode will change the class name, and update all the references to this class in other files.

What command would you use to create a service in angular?

Use ng generate to create the MessageService in src/app .


1 Answers

Currently Angular CLI doesn't support the feature of renaming or refactoring code. You can achieve such functionality with help of some IDE's

You can use Microsoft Visual studio code to achieve this with the help of a plugin

More details can be found here

you can follow the same steps described here

How to rename a component in Angular CLI?

like image 69
SAMUEL Avatar answered Oct 04 '22 02:10

SAMUEL