How to create mat-button-toggle-group as read only mode in AngularJS ?
Angular Material is a UI component library 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.
ng add @angular/material
- First, install the angular material using the above-mentioned command.
- After completing the installation, Import ‘MatButtonToggleModule,’ from ‘@angular/material’ in the app.module.ts file.
- Then use <mat-button-toggle-group> and </mat-button-toggle> tags to create angular button toggle group.
- As the MatButtonToggleModule doesn’t consist of read-only property, we can use the disabled property to make it read-only.
- Once done with the above steps then serve or start the project.
Observation: If you clearly observe the above output, you can understand that you can’t select and it is the way how read-only property looks like.