简体   繁体   中英

Get data from Firebase to Ionic(Angular)

在此处输入图片说明

home.html

 <ion-list > <ion-item *ngFor="let item of itemData | async">{{itemData.$value}}</ion-item> </ion-list> 

home.ts

 import { AngularFireDatabase, FirebaseListObservable, FirebaseObjectObservable } from 'angularfire2/database'; itemData: FirebaseListObservable<any[]>; constructor(public navCtrl: NavController, private fbd: AngularFireDatabase) { this.itemData = this.fbd.list('Arduino/Range1'); } 

I would like to data in the red box from to show in Ionic, What should I do?

==============================

Now I can use the data values And I have more questions.

I want to put data in position 1 to a variable value in position 2, what do I do?

在此处输入图片说明

I guess you just need to bind the properties

<ion-list >
  <ion-item *ngFor="let item of itemData | async">{{itemData.Range1}}</ion-item>
</ion-list>

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM