简体   繁体   中英

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

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.

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

<mat-spinner *ngIf="resourcesLoaded === false"></mat-spinner>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM