angular / angular/angularfire

collection() missing type arguments

Đang mở
#3,081 5 bình luận 11 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
7.8k
Fork
2.2k
Merge trung bình
22 giờ 28 phút
Pull request đã merge (30 ngày)
6

Mô tả

There are no exported functions for the collection function that allow a type to be specified. I see reference to collection() in the docs and in the upgrade information (screenshot below) but it isn't working in my project. If I try to add a type to get a typed collection reference, I get the error: Expected 0 type arguments, but got 1.

### Version info

**Angular:** 13.0.3

**Firebase:** 9.0.0

**AngularFire:** 7.2

**Other (e.g. Ionic/Cordova, Node, browser, operating system):** MacOs Montery

### How to reproduce these conditions

**Steps to set up and reproduce**

Attempt to create a collection reference with a custom type

**Sample data and security rules**

The data isn't important.

### Debug output

Error in VS Code:
![image](https://user-images.githubusercontent.com/13428680/144634937-1339e920-953c-4735-99df-9a3356c6d7b4.png)

AngularFire Upgrade Docs:
![image](https://user-images.githubusercontent.com/13428680/144635654-ad748e38-823d-4eeb-bfb8-0135096a75a1.png)

### Expected behavior

There should be a version of the collection function that takes a type. There are version of other functions that take a type and even expect a typed CollectionReference.

### Actual behavior

No function exists that takes a type.

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

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

Hướng nghiên cứu

Bắt đầu bằng cách xác định entry point collection() được export và so sánh nó với các hàm có kiểu khác được tham chiếu trong tài liệu upgrade. Tái hiện lỗi TypeScript với collection() bằng các phiên bản được liệt kê trong issue, sau đó xác minh rằng một kiểu tùy chỉnh được chấp nhận và tham chiếu collection kết quả được gán kiểu.

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, firebase, typescript
Lĩnh vực
databases
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

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.