<ion-select (ionChange)='onContextChange($event)' [(ngModel)]='bands' multiple=false cancelText='cancel' okText='Show songs from selected'>
<ion-option *ngFor='let band of bandsList$ | async' detail-push>
{{band.name}}
</ion-option>
</ion-select>
请看下面的代码:
onContextChange(ctxt:string):void{ this.songsList$=this.songService.assembleBandFilteredList(ctxt).snapshotChanges().pipe(map(changes=>{
return changes.map(c=>({ //This map is throwing error
key: c.payload.key, ...c.payload.val()
}));
}))
console.log(this.songsList$);
}
filterByString(band:string){
return this.angularFireDatabase.list('/song-list',ref=>ref.orderByChild('band').equalTo(band));
}
assembleBandFilteredList(ctxt:string):any{
let a= this.filterByString(ctxt);
console.log(a);
return a;
}
类型{}上不存在地图上的可观察到的给出错误