I'm dealing with a loading screen that typically takes between 15-30 seconds to load about 50 items onto the page. The loading process displays each item on the page using the message:
Loading item x
For each data call made to the database, an observable/subscription is used. When the data is received, the subscription triggers and adds it to an HTML string like this:
sync() {
this.syncStatus = "Starting sync"
this.syncService.sync().subscribe((status: string) => {
this.syncStatus += "<div>" + status + '</div>';
}, (error: string) => {
console.log(error);
}, () => {
this.Redirect();
});
}
<div class="description">
<span [innerHTML]="syncStatus"></span>
</div>
Currently, the list display can get cut off due to its length, especially when there are more than 50 items (sometimes even hundreds). I am looking for a way to display each individual item on the page for 5 seconds before hiding it. Any suggestions?