angular / angular/angular-cli

Ng generate always assumes an `app` folder

Aperta
#9,370 15 commenti 10 reazioni 0 assegnatari Vedi su GitHub
area: @schematics/angular feature feature: insufficient votes workaround1: obvious
Lingua principale
TypeScript
Stelle
27k
Fork
11.8k
Merge medio
14h 23m
PR unite (30g)
162

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo il comando `ng g c form-inputs/mike --skip-import --dry-run --app=client` con il `.angular-cli.json` mostrato. Traccia come `root` viene combinato con il percorso del componente generato, quindi verifica che la configurazione scelta crei i file nella posizione prevista senza presumere l’esistenza di una cartella `app`.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
cli
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.