Variable is not printing on screen. (See Image) - I'm a newbie

Good afternoon,

I’m having trouble displaying the return of an object.

It’s only working on first-level returns. (As shown in the picture).

What am I doing wrong?
I get the error: “TypeError: Cannot rea property ‘total’ of undefined at Object.eval [asupdateRendere]…”

I did not understand and I can not solve


Sorry my english :confused:

Your English is fine. Posting text as images instead of text is not.

That being said, when you are initializing resultado, you must give it at least {transactions: {}} to avoid this problem.

1 Like

It worked!!
Thanks :slight_smile:

Hello, I have managed to solve the problem, doing this …

Is there any easier way to do it?

Will I ever NEED to declare the keys?


export class ResumoPage {
  info = 'teste';
  infoRei = new Array();
  resultado = { transactions: {},
                metrics: {
                  sales: {},
                  claims: {},
                  delayed_handling_time: {},

    public navCtrl: NavController, 
    public navParams: NavParams,
    public MercadoLivreProvider: MercadoLivreProvider,
    public loadingController: LoadingController,
    platform: Platform) {
        this.loader = this.loadingController.create({
            content: "Buscando Usuários"

  ionViewDidLoad() {
    let eu = this;
    this.MercadoLivreProvider.getResumo().then( retorno => {  
      eu.resultado = (retorno as any);
      console.log(JSON.stringify(eu.resultado.metrics, null, 4));



<ion-content padding>
    <ion-grid class="reputacao">
      <ion-row class="a40" id="level{{ resultado.level_id }}">
        <ion-col col-1></ion-col>
        <ion-col col-2 class="r1"></ion-col>
        <ion-col col-2 class="r2"></ion-col>
        <ion-col col-2 class="r3"></ion-col>
        <ion-col col-2 class="r4"></ion-col>
        <ion-col col-2 class="r5"></ion-col>
        <ion-col col-1></ion-col>
          <ion-col col-3>
            <ion-icon name="cart"></ion-icon><br>
            {{ }}
          <ion-col col-9>
                  <ion-col col-12>{{ resultado.transactions.completed }}</ion-col>
                  <ion-col col-12>{{ resultado.transactions.canceled }}</ion-col>
                  <ion-col col-12>{{}}</ion-col>
                  <ion-col col-12>%</ion-col>