mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-21 22:34:21 +08:00
48 lines
860 B
Markdown
48 lines
860 B
Markdown
<!-- Links in /docs/documentation should NOT have `.md` at the end, because they end up in our wiki at release. -->
|
|
|
|
# ng generate service
|
|
|
|
## Overview
|
|
`ng generate service [name]` generates a service
|
|
|
|
## 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>flat</summary>
|
|
<p>
|
|
<code>--flat</code>
|
|
</p>
|
|
<p>
|
|
Flag to indicate if a dir is created.
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>module</summary>
|
|
<p>
|
|
<code>--module</code> (aliases: <code>-m</code>)
|
|
</p>
|
|
<p>
|
|
Specifies where the service should be provided.
|
|
</p>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>spec</summary>
|
|
<p>
|
|
<code>--spec</code>
|
|
</p>
|
|
<p>
|
|
Specifies if a spec file is generated.
|
|
</p>
|
|
</details>
|