Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 73935

Get selected value from the drop down list with Angular

$
0
0
<tr (click)="onRowClick(myDropDownList.value)">
<td>
<select #myDropDownList (click)="$event.stopPropagation()" (change)="onChange($event.target.value)">
    <option *ngFor="let n of numbers" [value]="n">{{n}}</option>
</select>
</td>
</tr>

I was trying to get selected value from the drop down list and assign it to the onRowClick function. But myDropDownList always appears to be undefined for some reason. I was wondering what might go wrong here.


Viewing all articles
Browse latest Browse all 73935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>