Reputation: 2503
In app.module.ts
import { provideFunctions, getFunctions } from '@angular/fire/functions';
@NgModule({
imports: [
...
provideFirebaseApp(() => initializeApp(environment.firebase)),
provideFunctions(() => getFunctions()),
],
In my app.component
export class AppComponent {
constructor(private fns: Functions) {}
hello() {
httpsCallable(
this.fns,
'test'
)('hello world').then(() => console.log('complete'));
}
}
This code works perfectly fine but why do I get this syntax error
Upvotes: 1
Views: 354
Reputation: 876
I'm not sure, but shouldn't it be
import { AngularFireFunctions as Functions } from '@angular/fire/compat/functions';
instead?
Based on functions docs.
So, it could be used as this.fns.httpsCallable('test')
.
Upvotes: 2