Error in displaying values


#21

This

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

gives you the right value like you want it in the console right ? Or am i wrong here ?


#22

yes,it gives the current balance with correct values as I want


#23

Okay what you could try.

this.finalBalance[this.accountsList[j]] = this.accounts.index;

And under export class you add this

index: any;

else if you need it in the string just add .toString() behind [this.accountsList[j]]


#24


#25

Try adding the string.

this.finalBalance[this.accountsList[j]].toString() = this.accounts.index;

also did you added

index: any;

below export class ?


#26
export class HomePage {
buttonColor: string = '#000';
	display: any = {};
	entry: any = {};
	register: any = [];
   accountsList : any = [];
	accountSelected: any;
	finalAmount: any;
	descShow: boolean;
	date:Date;
	finalBudget:number=0;
   accounts:any=[];
  	totalBudget: number = 0 ;
	  index: any;


#27

Try adding under export class

accountsList: any;

seperate even tho it might give you an error since you added it already, but you could try it. :confused:


#28

I am replying to your first post:

The [object Object] tells you that

contains an object and not something you can output.
What does finalBalance (which fills index) look like? Use console.log to find out.
Is the value you actually want to output in there? If so, add it’s key after index to access it.


#29

the issue have been resolved,making the following changes in html file…

<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'>
				<ion-col>{{ account.name }} </ion-col>
				<ion-col>{{ account.obalance }}</ion-col>
				<ion-col>{{ finalBalance[account.name] }}</ion-col>
	    </ion-row>
		<ion-row>
	            <ion-col>TOTAL</ion-col>
	            <ion-col>{{ totalBudget }}</ion-col>
	            <ion-col>{{ totalCurrentBalance }} </ion-col>
		</ion-row>
	</div>


#30

You are grossly abusing any. You should virtually never have any need to type that word in your code.