ng_generate
Use this tool to generate Angular artifacts like components, services, or modules by specifying the schematic, name, and path. Simplify development with optional flags for defaults, dry runs, and force overwrites.
Instructions
Run 'ng generate' to create a new Angular artifact (component, service, etc.)
Input Schema
Name | Required | Description | Default |
---|---|---|---|
appRoot | Yes | The absolute path to the first folder in the 'path' property. For example, if 'path' is 'webui/src/app/modules/alerts', then 'appRoot' should be the absolute path to 'webui'. | |
name | Yes | The name of the artifact to generate | |
options | No | Additional options for the schematic | |
path | No | The path where the artifact should be created, relative to the appRoot (do not include the app folder itself). For example, if the full path is 'webui/src/app/modules/alerts' and appRoot is 'webui', then path should be 'src/app/modules/alerts'. | src/app |
schematic | Yes | The schematic to generate (e.g., component, service) |