Наблюдаемые петля в шаблоне Angular 8
//.ts file
ngOnInit(): void {
this.pageData=this.service.getdata('/about_us_page/');
}
//.service file
getdata(tableName:string){
return this.db.list(tableName).snapshotChanges().pipe(map(changes => {
return changes.map(c => ({ key: c.payload.key, data:c.payload.val() }) ) }));
//return this.db.list(tableName);
}
//.html file
<ul class="" scope="row" *ngFor="let aboutus of this.pageData |async " >
<li>{{aboutus.key}} {{aboutus.data.details}} </li>
</ul>
Farwa Miraj