我是Firestore的新手,并从中学到了很多东西。在我的学习路径上,我已经到达了Firebase文档中关于Events for meta data changes的部分。 这看起来非常有用,但我无法理解如何测试它。这是文档中的代码 db.collection("cities").doc("SF")
.onSnapshot({
// Listen for document metadata changes
includeMetadataChanges: true
}, function(doc) {
使用下面的代码,我得到了错误Property 'subscribe' does not exist on type Auth。如果我从app.component.ts中删除整个订阅代码块,那么我不会得到任何错误,但是浏览器直接在主页上打开,而不是在登录页面上打开。在app.component.html的底部,我包含了<router-outlet></router-outlet>,
app.component.ts
import { Component } from '@angular/core';
import { Router } fr
我正在使用Firebase v9,我正在构建一个聊天应用程序,在调用onSnapShot获取聊天数据之前,我需要做一些异步工作: const getChat = async () => {
// I need to await for user data before doing anything else.
// I'll need some user data to build the query which
// I'll be using in onSnapShot later on.
在我使用Firestore (Firebase 9)的webapp中,我有以下代码,它应该根据getRecentProfilesExternal()函数中的参数关闭一个实时侦听器。它在ACTION1中工作,但在ACTION2中不起作用。
奇怪的是,我在ACTION2中得到了“未订阅”警报,尽管侦听器仍然处于活动状态。
谢谢你的帮助!
//Get profiles and update them in realtime
//The command param determines if the function should subscribe to changes (leave th
我有一个ionic2应用程序,并且正在使用Firebase和angularFire2。我希望使用angularFire2从防火墙获取当前身份验证状态和当前的auth对象/用户。
到目前为止,我可以对用户进行身份验证并订阅FirebaseAuthState来获取facebook用户对象。
constructor(platform: Platform, private auth: FirebaseAuth) {
auth.subscribe((user: FirebaseAuthState) => {
if (user) {
// I could s