LinuxCommandLibrary

ng-generate

creates Angular artifacts using schematics

TLDR

Generate component

$ ng generate component [name]
copy
Generate service
$ ng generate service [name]
copy
Generate module
$ ng generate module [name]
copy
Generate with shorthand
$ ng g c [name]
copy
Generate in specific path
$ ng generate component [path/name]
copy
Dry run
$ ng generate component [name] --dry-run
copy

SYNOPSIS

ng generate schematic name [options]

DESCRIPTION

ng generate creates Angular artifacts using schematics. Generates components, services, modules, and other building blocks. Supports shorthand g for generate. Part of Angular CLI.

PARAMETERS

component

Generate a component.
service
Generate a service.
module
Generate a module.
directive
Generate a directive.
pipe
Generate a pipe.
--dry-run
Preview without writing.
--skip-tests
Skip test file generation.

SEE ALSO

ng(1), ng-add(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community