ionic3 - ERROR Error: Uncaught (in promise): Error: InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'

陌路散爱 提交于 2019-12-02 10:53:08

You need to first convert the AngularFireList to an Observable :

contactsList: Observable<any[]>;

And in your constructor, you need to call valueChanges() on it. This is since AngularFire2 Version 5.

this.contactsList = this.firebaseService.getContactsList().valueChanges();

This will return the data through the observable without $key or $value. In order to print in html,use

  {{contact}}

instead of

  {{contact.$value}}

Try changing your contactsList declaration from

contactsList:AngularFireList<any>;

to

contactsList: Observable<any[]>;

Ensure that you're importing your Observable module as,

import { Observable } from 'rxjs/Observable'

Also your contactList variable assignment should be changed as,

this.contactsList = this.firebaseService.getContactsList().valueChanges(); 

Hope this helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!