我正在尝试使用GeoPoint
创建新的AngularFirestore
,但我一直收到一条错误消息,指出该方法不可用。除了firebase
之外,如何在不导入整个AngularFire
npm模块的情况下执行此操作?
import { Component, OnInit } from "@angular/core";
import {AngularFirestore, AngularFirestoreCollection} from "angularfire2/firestore";
@Component({
selector: "app-firebase-menu-bar",
templateUrl: "./firebase-menu-bar.component.html",
styleUrls: ["./firebase-menu-bar.component.css"]
})
export class FirebaseMenuBarComponent {
private itemsCollection: AngularFirestoreCollection<any>;
private AngularFirestoreCollection;
private draftCollection;
private productionCollection;
constructor(private db: AngularFirestore) {
// this.production = db.collection('/production').snapshotChanges();
this.db.firestore.GeoPoint(40, 100);
}
}
答案 0 :(得分:0)
从5版开始
import { firestore } from 'firebase/firestore';
...
new firestore.GeoPoint ...