Actually i need to get the $key in this AngularFireList, but i don't know how i do that, actually this is my code to a list, that works but don't rerieve the data with the $key:
getAutosByPlaca(placac: string): Observable<Auto[]> {
const placa$ = new Subject().startWith(placac);
return placa$.switchMap(placa => {
return this.db.list(this.dbPath, ref => ref.orderByChild('placa').equalTo(placac)).valueChanges();
});
}
valueChanges() returns the unpacked data. To get the meta data, you need snapshotChanges(), as documented here:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.