<mat-select> 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. <mat-select> tag is used to display the options in a dropdown.
ng add @angular/material
- First, install the angular material using the above-mentioned command.
- After completing the installation, Import ‘MatSelectModule’ from ‘@angular/material/select’ in the app.module.ts file.
- Then use <mat-select> tag to group all the items inside this group tag.
- Inside the <mat-select> tag we need to use <mat-option> tag for every item.
- We can also disable options using the disabled property.
- Once done with the above steps then serve or start the project.