Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Error in displaying values

$
0
0

@vithika wrote:

hello everyone,

I have created a summary page where I want to display the calculated final balance..but i am getting output as [object][object]..

html code--

		<div class="summary-block" *ngIf="display.summary" >
  <ion-row>
    <ion-col>Name </ion-col>
	<ion-col> Opening Balance</ion-col>
	<ion-col>Current Balance</ion-col>
    </ion-row>

    <ion-row *ngFor='let account of accounts;let index of finalBalance'>
			<ion-col>{{ account.name }} </ion-col>
			<ion-col>{{ account.obalance }}</ion-col>
			<ion-col>{{  index}}</ion-col>
    </ion-row>
	<ion-row>
            <ion-col>TOTAL</ion-col>
            <ion-col>{{totalBudget}}</ion-col>


        </ion-row>
</div>

ts file--

loadCheckbook(account)
	{

		this.store.get(account).then(data => {
			// console.log("Register --> "+data);

			this.register = JSON.parse(data) || {};
			if(data){
				this.finalAmount = this.register.checkbook[this.register.checkbook.length-1].balance;
			}
		});

		Object.keys(this.accountsList).map(key =>{
			console.log(this.accountsList[key]); // this should display the account name one by one

			for(let j=0; j<this.accountsList.length; j++){
			this.store.get(this.accountsList[key]).then(data => {

				let register = JSON.parse(data) || {};
				if(data){
					//this.finalBalance[this.accountsList[key]] = register.checkbook[register.checkbook.length-1].balance;
					this.finalBalance[this.accountsList[j]] = register.checkbook[register.checkbook.length-1].balance;
					//console.log(this.finalBalance);

				}
					console.log(this.finalBalance[this.accountsList[j]]);
			});
			}
		});



	}

I can get the final balance values being displayed in console,but getting error while displaying it in the html page..

please help me where i am wrong..and how can I achieve this..

Thanks

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>