Loading screen in Angular 6 [closed]

0

I have an application in Angular where it brings a lot of information from a database (more than 6000 elements). When the user clicks on a button, all those elements are displayed (they do not have to be paginated), I do that with an * ngFor, the issue is that it takes to load all those elements. Is there any way that you can load it, a loading screen or just a loading screen or something?

    
asked by Javi Tellez 13.11.2018 в 16:46
source

1 answer

1

You could create a div which you add a *ngIf which shows a (loading .., gitf or animation) while your data is loaded. It would be something like that.

<div *ngIf="!user">
  Cargando...
</div>

and your other div with the data

<div *ngIf='user'>
  <img src="{{ user.avatar }}" alt="">
  <h2>{{ user.first_name + ' ' + user.last_name }}</h2>
</div>
    
answered by 13.11.2018 в 17:10