Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

307
Views
Angular, Unable to display Data as a List from firebase

I am trying to display data from firebase in angular, but I can't seem to get the list objects from loading and it always leads to a blank with this error ERROR Error: InvalidPipeArgument: '' for pipe 'AsyncPipe'

I've even followed the fire module guide, but it doesn't seem to work.

Here is my component code

import {AngularFireDatabase,AngularFireList} from '@angular/fire/compat/database';
import { Observable } from 'rxjs';

@Component({
  selector: 'querydata',
  templateUrl: './querydata.component.html',
  styleUrls: ['./querydata.component.css']
})
export class QuerydataComponent implements OnInit {

  courses:any;
  constructor(private db :AngularFireDatabase) {
      
   }

  ngOnInit(): void {
     this.db.list('courses').valueChanges().subscribe(courses =>{
       this.courses=courses;
       console.log(this.courses);
     });
  }

}

and my template code

<p>querydata works!</p>

<ul *ngIf="courses">
    <li *ngFor="let course of courses | async">
        {{ course.value }}
    </li>
</ul>

Any help would be appreciated Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The variable 'courses' is not observable / async pipe but a value. this.db.list('courses').valueChanges()` would be observable, but su

Does this print something?

<li *ngFor="let course of courses">
    {{ course }}
</li>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!