Hello I tried to do the sum and I sale NaN, somebody can help me add the prices price with firebase
export class AboutPage {
meVendi: FirebaseListObservable<any>;
constructor(public navCtrl: NavController,public alertCtrl:AlertController, public database:AngularFireDatabase, public event:Events ) {
this.meVendi = this.database.list('/Evendido');
}
total_suma = 0;
suma (valor){
this.total_suma+=valor;
}
}
<ion-content padding>
<ion-list>
<ion-item-sliding *ngFor="let item of meVendi|async" >
<ion-item>
<ion-label>
<h1>Carlos Pidio</h1>
<ion-list>
<h2>{{item.Platito.name}} ${{item.Platito.price}} {{suma(item.Platito.price)}}</h2>
<h2>{{item.carnita.name}} ${{item.carnita.price}} {{suma(item.carnita.price)}}</h2>
<h2>{{item.Adicionar.name}} ${{item.Adicionar.price}} {{suma(item.Adicionar.price)}}</h2>
</ion-list>
</ion-label>
</ion-item>
</ion-item-sliding>
<span>total dela suma es: {{total_suma}}</span>
</ion-list>
</ion-content>