0

Am trying to bind an array into a list .binding part is working fine.but the default value of drop down is not showing. Initially array doesn't have any value.

code

<select (change)="select($event)" [(ngModel)]="drp_selectedValue" >
                    <option value ="">Select.....</option>
                    <option *ngFor="let list of dataList?.length > 0 " (click)="select(list)" [ngValue]="list">{{list.name}}</option>

                </select>

currently my list showing like this

enter image description here

Am also tried to check dataList length and put value="" ,but not working.what was wrong in my code?

arj
  • 887
  • 1
  • 15
  • 37

1 Answers1

5

Initially set drp_selectedValue as ''

drp_selectedValue = '';

Seba Cherian
  • 1,755
  • 6
  • 18