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

后端 未结 2 954
一向
一向 2021-01-27 08:18

I did a news comment function by ionic3 with firebase, after testing comment function working already, but when I want the comment showing in my project error coming out.

<
2条回答
  •  醉梦人生
    2021-01-27 09:00

    You need to first convert the AngularFireList to an Observable :

    contactsList: Observable;
    

    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}}
    

提交回复
热议问题