Skip to content

"AngularFireFunctions" documentation has two errors #3210

Open

Description

@tdkehoe

The example code in the AngularFireFunctions documentation doesn't compile. Here's the provided code, with comments on the two lines that don't compile:

import { Component } from '@angular/core';
import { AngularFireFunctions } from '@angular/fire/compat/functions';

@Component({
  selector: 'app-root',
  template: `{ data$  | async }` // doesn't compile
})
export class AppComponent {
  constructor(private fns: AngularFireFunctions) { 
    const callable = fns.httpsCallable('my-fn-name');
    this.data$ = callable({ name: 'some-data' });  // doesn't compile
  }
}

The template line needs double curly brackets:

template: `{{ data$  | async }}`

The next error is:

Property 'data$' does not exist on type 'AppComponent'.

6   template: `{{ data$  | async }}`,

I corrected this by making a variable data$: any.

This code now compiles:

import { Component } from '@angular/core';
import { AngularFireFunctions } from '@angular/fire/compat/functions';

@Component({
  selector: 'app-component',
  template: `{{ data$  | async }}`,
})
export class AppComponent {
  data$: any;

  constructor(private fns: AngularFireFunctions) { 
    const callable = fns.httpsCallable('my-fn-name');
    this.data$ = callable({ name: 'some-data' });
  }
}

Activity

  1. google-oss-bot commented on Apr 17, 2022

    @google-oss-bot

    This issue does not seem to follow the issue template. Make sure you provide all the required information.

  2. tdkehoe commented on Apr 17, 2022

    @tdkehoe
    Author

    Also, a sentence doesn't seem grammatical:

    Notice that calling httpsCallable() does not initiate the request. It creates a function, which when called creates an Observable, subscribe or convert it to a Promise to initiate the request.
    

    Maybe that should be:

    Notice that calling httpsCallable() does not initiate the request. It creates a function, which when called creates an Observable. Subscribe to the Observable or convert it to a Promise to initiate the request.
    
  3. sorcamarian commented on Dec 31, 2023

    @sorcamarian

    Where is the latest documentation about AngularFire with Cloud Functions?
    In Node.js functions.https.onCall and Angular httpsCallable

  4. added a commit that references this issue on Dec 3, 2026
    60e262e
  5. added
    comp: compat
    comp: docs
    comp: functions
    type: bug
    version: legacy (v7-v16)
    on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp: compatcomp: docscomp: functionstype: bugversion: legacy (v7-v16)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions