Ng generate always assumes an `app` folder

Đang mở
#9,370 15 bình luận 10 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
angular, typescript
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lệnh ng g c form-inputs/mike --skip-import --dry-run --app=client với .angular-cli.json được cung cấp. Theo dõi cách root được kết hợp với đường dẫn của component được tạo, sau đó xác minh rằng cấu hình đã chọn tạo các tệp ở vị trí dự kiến mà không giả định có thư mục app.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area: @schematics/angular feature feature: insufficient votes workaround1: obvious

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.

Ngôn ngữ chính
TypeScript
Star
27k
Fork
11.8k
Merge trung bình
16 giờ 35 phút
Pull request đã merge (30 ngày)
176

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của angular/angular-cli

Tất cả issue của angular/angular-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.