Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename angular app?

I have an angular app which I'd like to rename. Is there an easy way to rename the app other than renaming manually all the occurrences of the app name (like the folder name, in package.json, etc..)

Thanks!

like image 804
locke14 Avatar asked May 21 '18 09:05

locke14


People also ask

Can I rename angular project?

Search in your project wherever the old name is used. In Visual Studio Code search can be done by using the search bar provided. Replace old name with your new name. Rename the project folder name as well and you are done.

Can we rename app 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.

Is it possible to rename the app component?

Definitely. Any valid TypeScript class name can be used that doesn't conflict with other imports. AppComponent is only used in examples to make it clear that it is the root component without also adding @NgModule({ bootstrap: AppComponent, ...})

How do I rename my NX app?

Since Nx 8.12 you can do it by using the move schematic (or mv ) to 'move' the app to the same place but with the new wanted name. Or nx g mv --project oldNG newNG if I want to rename app from my default collection.


1 Answers

You cannot !!

By default, Angular will create a project/app using name/alias app But after creating a new project if you wish to change the selectors for new component/service etc.

Then you can change the configuration in .angular-cli.json file under the

"prefix": "app",  //change with your name here
like image 183
Pardeep Jain Avatar answered Sep 19 '22 14:09

Pardeep Jain