Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular4 <mat-progress-spinner> how to show and hide when a page load completes

Tags:

angular

I am implementing a loading spinner to my application. From this site https://material.angular.io/components/progress-spinner/overview I could not able to get more info to show and hide. I tried it out, but the spinner is always showing. Please help.

like image 435
Ghost Rider Avatar asked Dec 08 '22 16:12

Ghost Rider


1 Answers

The spinner component just displays the spinner. You have to add show/hide logic by yourself e.g creating a boolean in your component class and setting it to *ngIf directive:

<mat-spinner *ngIf="resourcesLoaded === false"></mat-spinner>
like image 176
Aleksi Avatar answered Dec 10 '22 11:12

Aleksi