I am working on the UI with clouds moving horizontally across the screen.
I have an array of items to be displayed on the clouds, each item of the array is a cloud. The component has css display absolute position so my current approach creates a stack of components on top of each other. My goal is instead of load the array's item one time, I want to load each one with a 4000ms of delay. I know we may need setTimeout() or setInterval() in the clouds.component.ts or the html template *ngFor.
I tried *ngFor="let setTimeout(() => item, 4000) of items"
but does not seem right.
Below is the structure of my components
cloud.component.ts
export class CloudComponent {
@Input('cloud') public element: {
....
// not important
}
}
clouds.component.html
<app-cloud *ngFor="let item of items" [cloud]="item"></app-cloud>
clouds.component.ts
export class CloudsComponent {
public clouds: Cloud[] = [item,item,item,item,item]
// service call
}