Prevent mat-option selection if condition
问题 I want to prevent mat-option from being selected because clicking on it will open a dialog. Only when selecting something from the dialog, should my option be selected. If nothing was selected from the dialog, mat-option should not be changed from previous value. <mat-select [(ngModel)]="filter_defaultSelectedValue" (change)="changeSelectedValue($event.value)"> <mat-option *ngFor="let filter of filters" [value]="filter"> <span *ngIf="filter.id != 'custom'; else content_dialog"> {{filter.label