2017-03-31 16:59:33 -07:00

2.2 KiB

ng generate component

Overview

ng generate component [name] generates a component

Options

app

--app (aliases: -a) default value: 1st app

Specifies app name to use.

change-detection

--change-detection (aliases: -cd)

Specifies the change detection strategy.

flat

--flat default value: false

Flag to indicate if a dir is created.

export

--export default value: false

Specifies if declaring module exports the component.

inline-style

--inline-style (aliases: -is) default value: false

Specifies if the style will be in the ts file.

inline-template

--inline-template (aliases: -it) default value: false

Specifies if the template will be in the ts file.

module

--module (aliases: -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 (aliases: -ve)

Specifies the view encapsulation strategy.