AngularFire httpsCallable Object(...) 不是函数
AngularFire httpsCallable Object(...) is not a function
我想在我的 Ionic 3 应用程序中调用 httpsCallable 函数。我正在尝试遵循这些文档:https://firebase.google.com/docs/functions/callable
我试过了:
const newGame = (firebase as any).functions().httpsCallable('findCreateGame');
newGame({}).then(function(result) {
console.log("In here.");
});
结果是:
ERROR TypeError: WEBPACK_IMPORTED_MODULE_5_firebase_functions.functions is not a function
我也在angularfire中尝试了新实现的包装器:
const newGame = this.afFunctions.httpsCallable('findCreateGame');
newGame({}).then(function(result) {
console.log("In here.");
});
ERROR TypeError: Object(...) is not a function
有没有人有这方面的经验?这是添加功能的拉取请求,如果有帮助的话。 https://github.com/angular/angularfire2/pull/1532
编辑---
此代码实际上调用了 Cloud 函数,即使它抛出相同的 'Not a function' 错误:
const newGame = this.afFunctions.httpsCallable('findCreateGame');
newGame();
我不确定还有什么方法可以调用该函数,即使 newGame
是 对象而不是函数引用。
抛出 Object(...) is not a function
因为你是 运行 rxjs 5,而不是 6。
如果升级,该功能将按预期执行。
有关 5 和 6 之间变化的更多详细信息,请参阅 rxjs migration doc。
在您的第一个示例中,确保您在调用函数的 ts 文件中导入 import 'firebase/functions'
。
我想在我的 Ionic 3 应用程序中调用 httpsCallable 函数。我正在尝试遵循这些文档:https://firebase.google.com/docs/functions/callable
我试过了:
const newGame = (firebase as any).functions().httpsCallable('findCreateGame');
newGame({}).then(function(result) {
console.log("In here.");
});
结果是:
ERROR TypeError: WEBPACK_IMPORTED_MODULE_5_firebase_functions.functions is not a function
我也在angularfire中尝试了新实现的包装器:
const newGame = this.afFunctions.httpsCallable('findCreateGame');
newGame({}).then(function(result) {
console.log("In here.");
});
ERROR TypeError: Object(...) is not a function
有没有人有这方面的经验?这是添加功能的拉取请求,如果有帮助的话。 https://github.com/angular/angularfire2/pull/1532
编辑---
此代码实际上调用了 Cloud 函数,即使它抛出相同的 'Not a function' 错误:
const newGame = this.afFunctions.httpsCallable('findCreateGame');
newGame();
我不确定还有什么方法可以调用该函数,即使 newGame
是 对象而不是函数引用。
抛出 Object(...) is not a function
因为你是 运行 rxjs 5,而不是 6。
如果升级,该功能将按预期执行。
有关 5 和 6 之间变化的更多详细信息,请参阅 rxjs migration doc。
在您的第一个示例中,确保您在调用函数的 ts 文件中导入 import 'firebase/functions'
。