I have an Angular application and I have Angular Material Radio Group I want to show and hide div based on Angular material radio selection my form is Reactive I searched other solutions were not reactive forms, thanks.
here is my code:
<div>
<label id="theschedule">Due: </label>
<mat-radio-group aria-labelledby="theschedule" formControlName="Schedule" >
<mat-radio-button id="{{sch_item.Name}}" *ngFor="let sch_item of schedule" class="example-radio-button" [value]="sch_item.ID" >
{{sch_item.Name}}
</mat-radio-button>
</mat-radio-group>
</div>
<div class="row-two input-row" fxLayout="row" fxLayout.lt-md="column" fxLayoutGap="20px" fxLayoutGap.lt-md="0px" [hidden]="myform.controls.Schedule.value=3">
<mat-form-field appearance="outline">
<input matInput [matDatepicker]="StartDate" placeholder="Start date *" [min]="sDate"
formControlName="StartDate">
<mat-label>Start Date *</mat-label>
<mat-datepicker-toggle matSuffix [for]="StartDate"></mat-datepicker-toggle>
<mat-datepicker #StartDate></mat-datepicker>
</mat-form-field>
<mat-form-field appearance="outline">
<input matInput [matDatepicker]="EndDate" placeholder="Due date *" [min]="mDate"
formControlName="EndDate">
<mat-label>Due date*</mat-label>
<mat-datepicker-toggle matSuffix [for]="EndDate"></mat-datepicker-toggle>
<mat-datepicker #EndDate></mat-datepicker>
</mat-form-field>
</div>