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!
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.
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.
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, ...})
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With