Ionic 3 firebase display data error -
currently able post data firebase, can't data , display in ionic 3 app. shoes.ts file:
import { component } '@angular/core'; import { navcontroller, navparams } 'ionic-angular'; import { angularfiredatabase } "angularfire2/database"; import { firebaselistobservable } 'angularfire2/database'; @component({ selector: 'page-shoes', templateurl: 'shoes.html', }) export class shoespage { shoppingitems: firebaselistobservable<any[]>; newitem = ''; getshoppingitems() { return this.afdb.list('/shoppingitems/'); } constructor(public navctrl: navcontroller, public navparams: navparams, public afdb: angularfiredatabase){ this.additem("awesomestuff"); this.getshoppingitems(); alert(this.shoppingitems); } ionviewdidload() { console.log('ionviewdidload shoespage'); } additem(name) { this.afdb.list('/shoppingitems/').push(name); } removeitem(id) { this.afdb.list('/shoppingitems/').remove(id); } }
this part of shoes.html file:
<ion-list> <ion-item class="text" *ngfor="let item of shoppingitems | async"> {{item.$value}} </ion-item> </ion-list>
any ideas how can able display firebase data? getting: [object object] when alert shoppinglist.
Comments
Post a Comment