My HTML
<mat-form-field class="button-spacing">
<mat-select placeholder="select" [(ngModel)]="dropDownOne">
<mat-option *ngFor="let first of test1" [value]="first"> {{ first }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field class="button-spacing">
<mat-select placeholder="select" [(ngModel)]="DropDownTwo" (change)="on()" [hidden]="show" [disabled]="dropDownOne== 'One'||dropDownOne == undefined ">
<mat-option *ngFor="let second of test2" [value]="second"> {{ second }}
</mat-option>
</mat-select>
</mat-form-field>
My TS
import { Component } from '@angular/core';
import { MatTableDataSource } from '@angular/material';
/**
* @title Basic use of `<table mat-table>`
*/
@Component({
selector: 'table-basic-example',
styleUrls: ['table-basic-example.css'],
templateUrl: 'table-basic-example.html',
})
export class TableBasicExample {
test1 =[
'One',
'Two'
]
test2 =[
1,2,3,4
]
show :boolean = true;
on(){
this.show = !this.show;
}
}
How to Hide/Show Drop Down here.! in First drop down i have option like "One" & "Two" when i clicked on One the second drop down must get hidden not disabled, and when i clicked on option "Two" from drop down first the second drop down will be shown to us How??
here it is my StackBliz Link -- > https://stackblitz.com/edit/drow-down-disabled12345677709-gfj1-gxqswz