HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

ng generate — Generate and/or modify files based on a schematic. More information: <https://angular.dev/cli/genera

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandfilesandmodifyng generateclibasedgenerate

Problem

How to use the ng generate command: Generate and/or modify files based on a schematic. More information: <https://angular.dev/cli/generate>.

Solution

ng generate — Generate and/or modify files based on a schematic. More information: <https://angular.dev/cli/generate>.

Generate AI configuration files for Angular project:
ng {{[g|generate]}} ai-config


Create a new service:
ng {{[g|generate]}} {{[s|service]}} {{service_name}}


Generate a new application within the workspace:
ng {{[g|generate]}} {{[app|application]}} {{app_name}}


Create a new class:
ng {{[g|generate]}} {{[cl|class]}} {{class_name}}


Create a new component:
ng {{[g|generate]}} {{[c|component]}} {{component_name}}


Create a new directive:
ng {{[g|generate]}} {{[d|directive]}} {{directive_name}}


Create a new enum:
ng {{[g|generate]}} {{[e|enum]}} {{enum_name}}


Create a new pipe:
ng {{[g|generate]}} {{[p|pipe]}} {{pipe_name}}

Code Snippets

Generate AI configuration files for Angular project

ng {{[g|generate]}} ai-config

Create a new service

ng {{[g|generate]}} {{[s|service]}} {{service_name}}

Generate a new application within the workspace

ng {{[g|generate]}} {{[app|application]}} {{app_name}}

Create a new class

ng {{[g|generate]}} {{[cl|class]}} {{class_name}}

Create a new component

ng {{[g|generate]}} {{[c|component]}} {{component_name}}

Context

tldr-pages: common/ng generate

Revisions (0)

No revisions yet.