Firebase AngularFire HttpScalable对象(…)不是函数
我想在我的Ionic 3应用程序中调用HttpScalable函数。我正在尝试遵循以下文档: 我试过:Firebase AngularFire HttpScalable对象(…)不是函数,firebase,google-cloud-functions,angularfire2,Firebase,Google Cloud Functions,Angularfire2,我想在我的Ionic 3应用程序中调用HttpScalable函数。我正在尝试遵循以下文档: 我试过: const newGame = (firebase as any).functions().httpsCallable('findCreateGame'); newGame({}).then(function(result) { console.log("In here."); }); 这导致: 错误类型错误:WEBPACK\u IMPORTED\u MODU
const newGame = (firebase as any).functions().httpsCallable('findCreateGame');
newGame({}).then(function(result) {
console.log("In here.");
});
这导致:
错误类型错误:WEBPACK\u IMPORTED\u MODULE\u 5\u firebase\u函数。函数不是函数
我还在angularfire中尝试了新实现的包装器:
const newGame = this.afFunctions.httpsCallable('findCreateGame');
newGame({}).then(function(result) {
console.log("In here.");
});
错误类型错误:对象(…)不是函数
有人有过这方面的经验吗?这里是添加功能的请求,如果这有帮助的话
编辑---
此代码实际上调用云函数,即使它抛出相同的“nota function”错误:
const newGame = this.afFunctions.httpsCallable('findCreateGame');
newGame();
我不知道如何调用函数,即使newGame
是一个对象而不是函数引用。抛出对象(…)不是函数,因为您运行的是rxjs 5,而不是6
如果升级,该功能将按预期执行
有关5和6之间更改的更多详细信息,请参阅。在第一个示例中,确保在调用函数的ts文件中导入导入“firebase/functions”