ngfor select dropdown value as selected code example
Example: select with ngFor on option and ul
<div>
<ul *ngFor="let sentence of sentences;let i = index;" class="collection">
<li class="collection-item">
<p [ngClass]="{'red': sentence?.disco == 1 , 'green': sentence?.disco == 2 }">{{sentence.viewValue}} </p>
<p style="margin-left:20px; font-size:12px!important">
<select #val (change)="onChange(val.value,i)">
<option *ngFor="let cat of foods" [value]="cat.value" >
{{cat.viewValue}}
</option>
</select>
</p>
</li>
</ul>
</div>