I tried to retrieve data from firebase database as this tutorial but I get this error;
Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.(AngularFireList)
I want to retrieve specific data for the current user (when user login to the app)
can anyone help me to solve this problem
this html page
<ion-content padding>
<!-- مسسوول عن عرض البيانات -->
<ul *ngFor ="let d of datanote " class="collection" class="colorul" text-right >
<li class= "collection-item" >
<ion-card class="backgounddiv" >
<ion-card-header>
<strong class="colorli" >{{d.title}}<br></strong>
</ion-card-header>
<ion-card-content>
<strong class="colorli" >{{d.desciption}}</strong>
</ion-card-content>
</ion-card>
</li>
</ul>
</ion-content>
this ts page
export class HomePage {
datanote :AngularFireList<users[]> ;
userId: string;
constructor(
public navCtrl: NavController,
private ev: Events,
public firestoreService:FierbaceserverProvider,
public navParams: NavParams,
private afAuth: AngularFireAuth,
private db: AngularFireDatabase
) { }
ngOnInit():AngularFireList <users[]> {
if (this.userId) return;
this.datanote=this.db.list(`note-list/${this.userId}`);
return this.datanote;
}
}
console.log(this.datanote)
what do you see? Object? Array? AlsongOnInit()
returnsvoid
see angular doc - penleychan