Angular 5 I cant get the dropdown menu to display the "category", the category exsist in item.category and categories, and is the same. I've tried with ngModel and ngValue and just value and cant get it to work
<td>
<select [(ngModel)]="item.category">
<option style="display:none">select a category</option>
<option *ngFor="let item of categories" [ngValue]="item.category" value="item.category">{{item.category}}</option>
</select>
</td>
For me work like this:
<select [(ngModel)]="category" id="category">
<option value="" disabled selected>select a category</option>
<option *ngFor="let item of categories" [value]="item.category">{{item.category}}</option>
</select>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With