generate component

Hans Larsen edited this page May 3, 2018 · 6 revisions

ng generate component

Overview

ng generate component [name] generates a component

Options

dry-run

--dry-run (alias: -d)

Run through without making any changes.

force

--force (alias: -f)

Forces overwriting of files.

project

--project

The name of the project.

inline-style

--inline-style (alias: -s)

Specifies if the style will be in the ts file.

inline-template

--inline-template (alias: -t)

Specifies if the template will be in the ts file.

view-encapsulation

--view-encapsulation (alias: -v)

Specifies the view encapsulation strategy.

change-detection

--change-detection (alias: -c)

Specifies the change detection strategy.

prefix

--prefix (alias: -p)

The prefix to apply to generated selectors.

styleext

--styleext

The file extension to be used for style files.

spec

--spec

Specifies if a spec file is generated.

flat

--flat

Flag to indicate if a dir is created.

skip-import

--skip-import

Flag to skip the module import.

selector

--selector

The selector to use for the component.

module

--module (alias: -m)

Allows specification of the declaring module.

export

--export

Specifies if declaring module exports the component.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.