feat(table): typescript/strong typing of cell templates
- Ngôn ngữ chính
- TypeScript
- Star
- 25k
- Fork
- 6.8k
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 91
Mô tả
#### Feature Description
Currently, `*matCellDef` types the resulting variable as `any`:

This issue is an attempt to bring https://github.com/angular/components/issues/16273 back in discussion, which has been closed as Ivy wasn't yet available.
There has been some progress on several fronts:
- Ivy now has `strictTemplates` mode.
- The experimental Ivy powered language server is almost ready to go.
It appears that the approach described in this comment https://github.com/angular/angular/issues/28731#issuecomment-782806178 might allow this to be implemented.
#### Use Case
As we've been converting more code to use Material Data Tables, the lack of strong typing has been really problematic, and it feels like a downgrade in developer experience compared to regular tables with `*ngFor`.
Further motivation for this has been described in:
https://github.com/angular/components/issues/16273
https://github.com/angular/angular/issues/28731
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách xem xét ngữ cảnh strictTemplates của Angular và các thảo luận được liên kết trong angular/components#16273 và angular/angular#28731, đặc biệt là phương pháp triển khai được tham chiếu. Xác định các entry point bị ảnh hưởng đối với việc định kiểu cell-template của bảng Material và cách language service xử lý chúng. Được xem là hoàn tất khi các biến cell-template nhận được các kiểu hữu ích tại thời điểm biên dịch thay vì any, với độ bao phủ cho các trường hợp template liên quan.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- angular, typescript
- Lĩnh vực
- developer-experience, frontend
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100