【发布时间】:2021-12-07 11:45:51
【问题描述】:
在 app.module.ts 中
import { provideFunctions, getFunctions } from '@angular/fire/functions';
@NgModule({
imports: [
...
provideFirebaseApp(() => initializeApp(environment.firebase)),
provideFunctions(() => getFunctions()),
],
在我的 app.component 中
export class AppComponent {
constructor(private fns: Functions) {}
hello() {
httpsCallable(
this.fns,
'test'
)('hello world').then(() => console.log('complete'));
}
}
这段代码运行得很好,但是为什么会出现这个语法错误
【问题讨论】:
标签: javascript angular firebase google-cloud-functions angularfire2