i need your help, i\'m trying to display some datas from my firebase but it trhows me an error like InvalidPipeArgument: \'[object Object]\' for pipe \'AsyncPipe\'
I found another solution to get the data. according to the documentation Please check documentation link
In service file add following.
import { Injectable } from '@angular/core';
import { AngularFireDatabase } from 'angularfire2/database';
@Injectable()
export class MoviesService {
constructor(private db: AngularFireDatabase) {}
getMovies() {
this.db.list('/movies').valueChanges();
}
}
In Component add following.
import { Component, OnInit } from '@angular/core';
import { MoviesService } from './movies.service';
@Component({
selector: 'app-movies',
templateUrl: './movies.component.html',
styleUrls: ['./movies.component.css']
})
export class MoviesComponent implements OnInit {
movies$;
constructor(private moviesDb: MoviesService) {
this.movies$ = moviesDb.getMovies();
}
In your html file add following.
- {{ m.name }}