generate class

Create an Angular class.

Overview

ng generate class <schematic> <name> [options] or ng g class <schematic> <name> [options] generates class.

Arguments

schematic (optional) The schematic or collection:schematic to generate.

name (required) The name of the class.

Options

--dryRun (alias -d) Run through without making any changes.

--force (alias -f) Forces overwriting of files.

--project The name of the project.

--spec Specifies if a spec file is generated.

--type Specifies the type of class.

Example

ng generate class my-class

Last updated