Display images from array


#1

Hi Guys im new to this so dont really know how it works

im making a flash-card app and am using a function to determine if the user click the correct card.

at the moment the card are randomly display out of a array i need to to display from 0 in the array to the greatest number in the array, then once the array is at the greatest number go back to 0 and start again.

then once that process is over check is theres a id in the array that has =>3 correct answers take it and remove it from the array and replace it with another card from another array.

this.random = this.cardinsession[Math.floor(Math.random() * this.cardinsession.length)]

this.cardinsession is the array i want to use as my training array.

this.test = _.shuffle(this.CardService.cardList);

this.test is the big array

ill be so greatful for your help.
thanks so much


#2

Can you provide a greater explanation? I get what you want to accomplish but don’t know how you want to implement it.
You can use code format on the forum or stackblitz.
You may want to try ng-repeat directive, the rest is basic typescript sorting and event launching.


#3

honestly i dont know how i want to do it ill send screen shots soon

so the secound array of 7 is the one im using to display my data and once an array has the value of 3 remove it and replace it with a random card from the first array


#4

thanks so much for your help julu14


#5

I did nothing, great job and it is very useful that you posted the code for others to solve the same issue.


#6

what do you think the solution to is is?