Introduce "add-type-to-class-name" option to Ng Generate Application and Ng New

Đang mở
#31,582 3 bình luận 0 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
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
angular, typescript
Lĩnh vực
cli, tooling

Hướng nghiên cứu

Bắt đầu với các entry point của lệnh ng new và ng generate application cùng cấu hình schematics trong angular.json được mô tả trong issue. Theo dõi cách các tùy chọn ứng dụng được áp dụng, sau đó xác minh rằng tùy chọn được yêu cầu có thể đặt addTypeToClassName cho việc tạo component, service và directive trong tương lai.

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
Command

new, generate

Description

To enhance Angular CLI so that developer can control whether the app component generated during ng new or ng generate application will have the Type appended to its class name (i.e AppComponent) or not.

In addition, to allow developer to set a default angular.json's schematics "addTypeToClassName" to true via command line, so that future creation of component (include service and directive) via CLI will by default include the type inside the classname.

Describe the solution you'd like
  1. introduce add-type-to-class-name option to Ng Generate Application and Ng New, OR
  2. rename the "file-name-style-guide" option to "style-guide", with 4 possible values
    addTypeToClassNameOnly, addTypeToFileNameOnly, addTypeToFileAndClassName, 2025

Doing so, will set the addTypeToClassName to true inside the angular.json for component, service and directive

Describe alternatives you've considered

Currently, developer has to manually change the class name for the App Component to include the Type

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.