How to enable and disable a mat-button based on a select form

If you look at Angular Material Demos (button), which is an older version of Angular Material demo, there is a button performing this.

This demo used to correspond (it’s now outdated) to the demo on the Angular GitHub page, see: github.com – Angular Material – src/demo-app/button.

You can simply use:

<button mat-button [disabled]="isDisabled">

where isDisabled is a boolean define in your component.

Leave a Comment