简体   繁体   English

从Firebase获取数据到Ionic(Angular)

[英]Get data from Firebase to Ionic(Angular)

在此处输入图片说明

home.html home.html

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

home.ts 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? 我想将红色框中的数据显示在Ionic中,我该怎么办?

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

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? 我想将位置1的数据放入位置2的变量值,该怎么办?

在此处输入图片说明

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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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