angular / angular/angular-cli

Ng generate always assumes an `app` folder

オープン
#9,370 コメント 15 件 リアクション 10 件 担当者 0 名 GitHub で見る
area: @schematics/angular feature feature: insufficient votes workaround1: obvious
主要言語
TypeScript
スター
27k
フォーク
11.8k
平均マージ
14時間 23分
マージ済み PR(30日)
162

説明

Our project setup doesn't have an immediate sub-folder of app, however, it appears that running ng generate always assume that you have an `app` folder under the app root folder you specified in .angular-cli.json

### Versions
```
Angular CLI: 1.6.0
Node: 7.0.0
OS: darwin x64
Angular:
...
```

### Repro steps
* Setup a simple .angular-cli.json with:
```
{
"apps": [
{
"name": "client",
"root": "projects/client"
}
]
}
```
* Run:
```
ng g c form-inputs/mike --skip-import --dry-run --app=client
```

### Observed behavior
You'll see the output path always assumes an `app` folder:

```
create projects/client/app/form-inputs/mike/mike.component.css (0 bytes)
create projects/client/app/form-inputs/mike/mike.component.html (23 bytes)
create projects/client/app/form-inputs/mike/mike.component.spec.ts (614 bytes)
create projects/client/app/form-inputs/mike/mike.component.ts (261 bytes)
```

### Desired behavior
I'd like an option to be able to configure whether your project has the `app` folder or not. Or maybe an option to configure the whole path the component gets created in.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、示されている `.angular-cli.json` を使って `ng g c form-inputs/mike --skip-import --dry-run --app=client` コマンドを再現します。設定された `root` が生成されたコンポーネントのパスとどのように結合されるかを追跡し、選択した設定によって `app` フォルダーを前提とせず、意図した場所にファイルが作成されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。