I have an Angular component in which I created a two mat select fields.
My HTML code:
<mat-form-field>
<mat-select placeholder="Type" [(ngModel)]="Nm">
<mat-option [value]="'list'">
List
</mat-option>
<mat-option [value]="'text'">
Text
</mat-option>
<mat-option [value]="'radio'">
Radio
</mat-option>
<mat-option [value]="'label'">
Label
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Read" [(ngModel)] = "readFl">
<mat-option [value]="'Y'">Yes</mat-option>
<mat-option [value]="'N'">No</mat-option>
</mat-select>
</mat-form-field>
I have given default values to the two select options
public Nm: string = 'list';
public readFl: string = 'N';
I have a condition where if the selected value from the first dropdown is label, then the second dropdown should be disabled and the value should be changed to Yes.
How can I achieve such change with changing the value in the first dropdown?