mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-21 22:34:21 +08:00
29 lines
892 B
Markdown
29 lines
892 B
Markdown
<!-- Links in /docs/documentation should NOT have `.md` at the end, because they end up in our wiki at release. -->
|
|
|
|
# ng generate component
|
|
|
|
## Overview
|
|
`ng generate component [name]` generates a component
|
|
|
|
## Options
|
|
`--app` Specifies app name or index to use.
|
|
|
|
`--change-detection` (`-cd`) Specifies the change detection strategy.
|
|
|
|
`--flat` Flag to indicate if a dir is created.
|
|
|
|
`--export` Specifies if declaring module exports the component.
|
|
|
|
`--inline-style` (`-is`) Specifies if the style will be in the ts file.
|
|
|
|
`--inline-template` (`-it`) Specifies if the template will be in the ts file.
|
|
|
|
`--module` (`-m`) Allows specification of the declaring module.
|
|
|
|
`--prefix` Specifies whether to use the prefix.
|
|
|
|
`--skip-import` Allows for skipping the module import.
|
|
|
|
`--spec` Specifies if a spec file is generated.
|
|
|
|
`--view-encapsulation` (`-ve`) Specifies the view encapsulation strategy. |