<mat-progress-spinner> in Angular Material
Angular Material is a UI component library that is developed by the Angular team to build design components for desktop and mobile web applications. In order to install it, we need to have angular installed in our project, once you have it you can enter the below command and can download it.
The <mat-progress-spinner> and <mat-spinner> tag is used to indicate the progress of an event or activity. Depending on the type they move in a circle way.
ng add @angular/material
- First, install the angular material using the above-mentioned command.
- After completing the installation, Import ‘MatProgressSpinnerModule’ from ‘@angular/material/progress-spinner’ in the app.module.ts file.
- To use spinners we need to simply use <mat-spinner> tag.
- They are two types of progress bars like determinate and indeterminate.
- Indeterminate the spinner will not rotate but in the case of indeterminate, the spinner rotates continuously.
- For determinate type spinners, we need to give value in order to display them.
- If we want to change the theme then we can change it by using the color property. In angular we have 3 themes, they are primary, accent, and warn.
- Once done with the above steps then serve or start the project.