angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Introduce "add-type-to-class-name" option to Ng Generate Application and Ng New

Open hannah23280 opened this issue 2 months ago • 2 comments

Command

new, generate

Description

To enhance Angular CLI so that developer can control whether the app component generated during ng new or ng generate application will have the Type appended to its class name (i.e AppComponent) or not.

In addition, to allow developer to set a default angular.json's schematics "addTypeToClassName" to true via command line, so that future creation of component (include service and directive) via CLI will by default include the type inside the classname.

Describe the solution you'd like

  1. introduce add-type-to-class-name option to Ng Generate Application and Ng New, OR
  2. rename the "file-name-style-guide" option to "style-guide", with 4 possible values addTypeToClassNameOnly, addTypeToFileNameOnly, addTypeToFileAndClassName, 2025

Doing so, will set the addTypeToClassName to true inside the angular.json for component, service and directive

Describe alternatives you've considered

Currently, developer has to manually change the class name for the App Component to include the Type

hannah23280 avatar Oct 23 '25 13:10 hannah23280

This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.

You can find more details about the feature request process in our documentation.

angular-robot[bot] avatar Oct 24 '25 13:10 angular-robot[bot]

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

angular-robot[bot] avatar Dec 02 '25 13:12 angular-robot[bot]