mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 11:03:53 +08:00
118 lines
2.2 KiB
Markdown
118 lines
2.2 KiB
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
|
|
<details>
|
|
<summary>app</summary>
|
|
<p>
|
|
<code>--app</code> (aliases: <code>-a</code>) <em>default value: 1st app</em>
|
|
</p>
|
|
<p>
|
|
Specifies app name to use.
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>change-detection</summary>
|
|
<p>
|
|
<code>--change-detection</code> (aliases: <code>-cd</code>)
|
|
</p>
|
|
<p>
|
|
Specifies the change detection strategy.
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>flat</summary>
|
|
<p>
|
|
<code>--flat</code> <em>default value: false</em>
|
|
</p>
|
|
<p>
|
|
Flag to indicate if a dir is created.
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>export</summary>
|
|
<p>
|
|
<code>--export</code> <em>default value: false</em>
|
|
</p>
|
|
<p>
|
|
Specifies if declaring module exports the component.
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>inline-style</summary>
|
|
<p>
|
|
<code>--inline-style</code> (aliases: <code>-is</code>) <em>default value: false</em>
|
|
</p>
|
|
<p>
|
|
Specifies if the style will be in the ts file.
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>inline-template</summary>
|
|
<p>
|
|
<code>--inline-template</code> (aliases: <code>-it</code>) <em>default value: false</em>
|
|
</p>
|
|
<p>
|
|
Specifies if the template will be in the ts file.
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>module</summary>
|
|
<p>
|
|
<code>--module</code> (aliases: <code>-m</code>)
|
|
</p>
|
|
<p>
|
|
Allows specification of the declaring module's file name (e.g `app.module.ts`).
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>prefix</summary>
|
|
<p>
|
|
<code>--prefix</code>
|
|
</p>
|
|
<p>
|
|
Specifies whether to use the prefix.
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>skip-import</summary>
|
|
<p>
|
|
<code>--skip-import</code> <em>default value: false</em>
|
|
</p>
|
|
<p>
|
|
Allows for skipping the module import.
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>spec</summary>
|
|
<p>
|
|
<code>--spec</code>
|
|
</p>
|
|
<p>
|
|
Specifies if a spec file is generated.
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>view-encapsulation</summary>
|
|
<p>
|
|
<code>--view-encapsulation</code> (aliases: <code>-ve</code>)
|
|
</p>
|
|
<p>
|
|
Specifies the view encapsulation strategy.
|
|
</p>
|
|
</details>
|