2017-03-29 10:55:53 +01:00

2.0 KiB

ng generate component

Overview

ng generate component [name] generates a component

Options

app

`--app` (alias: `-a`) _default value: 1st app_

Specifies app name to use.

change-detection

`--change-detection` (alias: `-cd`)

Specifies the change detection strategy.

flat

`--flat` _default value: false_

Flag to indicate if a dir is created.

export

`--export` (alias: `-`) _default value: false_

Specifies if declaring module exports the component.

inline-style

`--inline-style` (alias: `-is`) _default value: false_

Specifies if the style will be in the ts file.

inline-template

`--inline-template` (alias: `-it`) _default value: false_

Specifies if the template will be in the ts file.

module

`--module` (alias: `-m`)

Allows specification of the declaring module's file name (e.g `app.module.ts`).

prefix

`--prefix`

Specifies whether to use the prefix.

skip-import

`--skip-import` _default value: false_

Allows for skipping the module import.

spec

`--spec`

Specifies if a spec file is generated.

view-encapsulation

`--view-encapsulation` (alias: `-ve`)

Specifies the view encapsulation strategy.