Reputation: 79
I manage to make my array to work on the console.
When I click the button the array shows on the console, but not on my HTML.
TS:
jogar(){
for(var u=0;u<6;u++){
this.y = Math.ceil(Math.random()*59+1);
this.random.push(this.y);
};
};
HTML:
<ion-card-content>
<button ion-button color="secondary" (click)="jogar()">Jogar</button>
<p>{{random}}</p>
</ion-card-content>
How can I make it work?
Upvotes: 0
Views: 84
Reputation: 1
you should use ngFor
directive to show the values
<p *ngFor="let r of random">{{r}}</p>
Upvotes: 1