How to collect data from more select option drop down angul?
i create more derop down list dynamically but my problem is how
to collect all selected from drop down list created
suppose i created two drop dow
then i need to generate statment from selected as below
dropdown1 = 'fruit' and dropdown2='banana'
- onChange($event)
- {
- let textdata=$event.target.options[$event.target.options.selectedIndex].text;
- let statusdata:any = this.FilterBinddata.filter(s=>s.reportSource==textdata)[0].reportSource2;
- console.log("textdata is" + textdata)
- console.log("statusdata is" + JSON.stringify(statusdata))
- }
- <div class="form-group" style="display: flex; align-items: center;margin-top:10px;margin-left:20px;">
- <div *ngFor="let fil of FilterList" style="padding-bottom: 10px;margin-right: 10px;">
- {{fil.controlName | slice:3:15}}
- <Select id="{{fil.controlName}}" (change)="onChange($event)" class="form-control" style="width:200px; margin-right:10px;">
-
-
-
- <option value="0">-Select-</option>
- <option *ngFor="let fil2 of this.FilterBinddata" >
- <div *ngIf="fil.controlName===fil2.filterName" >
- {{fil2.reportSource}}
- </div>
- </option>
-
-
-
-
- </Select>
-
- <div>
- </div>
-
- </div>