Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49361

Call a function automatically when my html is loaded

$
0
0

@maximegouin wrote:

Hi everyone,

I’m trying to run a function when my list is loaded. To do this, I’m using ngFor to get my data from my array but for one field I need to call a function with a property from this array.
Do you know how can I do it?

This is my code:

<ion-row *ngFor="let rank of rank">
            <ion-col col-4 onload="getName({id: rank.id})">
              // Want my team name here
            </ion-col>
            <ion-col col-2>
              {{rank.played}}
            </ion-col>
            <ion-col col-2>
              {{rank.goal_in}} : {{rank.goal_out}}
            </ion-col>
            <ion-col col-2>
              {{rank.difference}}
            </ion-col>
            <ion-col col-2>
                {{rank.points}}
            </ion-col>
      </ion-row>

but here my function getName is not called
thanks for your time

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49361

Latest Images

Trending Articles



Latest Images

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