小编Joh*_*ohn的帖子

AngularFirestore:类型“QueryDocumentSnapshot<any>”上不存在属性“id”

这是 Angular5 和 Firestore 的问题

我想做的事

  • 获取一个 Firestore 集合,它在我的数据库中被称为 minutes

  • 将我的组件变量(也称为 )设置minutes为一个包含每个minute文档 ID的 Observable 对象。

现在我收到这个错误

Property 'id' does not exist on type 'QueryDocumentSnapshot<any>'

这是我从 Firestore 收集收藏的地方

minutesArray: AngularFirestoreCollection<any>;
minutes: Observable<any[]>;

constructor(private afs: AngularFirestore) {
  this.minutesArray = afs.collection<any>('minutes', ref => ref.orderBy('year', 'desc'));
  this.minutes = this.minutesArray
                   .snapshotChanges()
                   .pipe(map(actions => actions.map(a => {
                       const data = a.payload.doc.data();
                       #### NEXT LINE ERRORS OUT ####
                       const id = a.payload.doc.id;
                       return { id, ...data };
                     }))
                   );
Run Code Online (Sandbox Code Playgroud)

为什么会抛出这个错误?

这个Github 问题 …

firebase typescript angular google-cloud-firestore

6
推荐指数
1
解决办法
2892
查看次数

React Native: match multiple Maven urls to specific dependencies?

Please don't mark this as duplicate. I've spent two days scouring Github, Stack, Android Studio docs, RN docs, and Gradle docs looking for an answer.

The Problem

Our React Native project won't build on Android. One build error is

Could not find com.github.wix-playground:ahbottomnavigation:2.4.9
Run Code Online (Sandbox Code Playgroud)

The fix for this error is to add maven { url 'https://jitpack.io' } to the project build.gradle

After adding this, however, we get a second error, which is

Execution failed for task ':react-native-ble-plx:compileDebugJavaWithJavac'
Run Code Online (Sandbox Code Playgroud)

The fix for this …

maven build.gradle android-gradle-plugin react-native react-native-android

5
推荐指数
1
解决办法
219
查看次数