I am currently working on a Reactive form in Angular 7 that includes 2 dropdowns (select) which are supposed to function as cascading dropdowns. However, I am facing an issue where the cascading dropdowns are not working as intended. Whenever I select an option from the first dropdown, it displays [object Object] instead of the actual value. You can refer to this Link for more details.
Template:
<form [formGroup]="reportForm">
<div class='col-12 col-sm-6'>
<div class="form-group " >
<label >Transformation Type</label>
<select name="select" formControlName="transformationType" class="form-control" placeholder="Select User Type" >
<option value="0" disabled selected>Select a Criteria</option>
<option *ngFor="let item of datasources" [value]="item">{{item.title}}</option>
</select>
</div>
</div>
<div class='col-12 col-sm-6'>
<div class="form-group " >
<label >User Type:</label>
<select formControlName="whereInput" class="form-control">
<option value="0" selected>Select an Option</option>
<option *ngFor="let item of units" [value]="item">{{item}}</option>
</select>
</div>
</div>
</form>
Component:
this.ifscSingle.controls.transformationType.valueChanges.subscribe(data => {
console.log(data);
})