I am able to save to firebase but could not retrieve the items as a list. It gives me the error as such: Uncaught(in promise): Error: InvalidPipeArgument'[Object.Object]' for pipe 'AsyncPipe'...
I am following a tutorial that still uses the FirebaseListObservable. But I can't get it to work since it is depecrated. Using the AgularFireList, I cant't list the items.
Below is how I try to retrieve the items from firebase to Ionic app:
import { AngularFireDatabase, AngularFireList } from "angularfire2/database";
export class ShoppingListPage {
shoppingListRef$: AngularFireList<any[]>
constructor(private navCtrl: NavController,
private navParams: NavParams,
private database: AngularFireDatabase) {
this.shoppingListRef$ = database.list('/shopping-list');
}
navigateToAddShoppingPage() {
// navigate the user to the Add SHopping Page
this.navCtrl.push('AddShoppingPage');
}
}
This is in the html:
<ion-content padding>
<ion-list>
<ion-item *ngFor="let item of shoppingListRef$ | async">
<h2>Item Name: {{item.itemName}}</h2>
<h3>Amount: {{item.itemNumber}}</h3>
</ion-item>
</ion-list>
</ion-content>
Please help. Thank you.
