html - Angular - select placeholder not showing -
there reason why simple code won't work? i'm trying have placeholder on select, shows 1 of other options in list.
<div *ngfor="let d of formdatirichiesta" class="form-row"> <select *ngif="d.type=='select'" class="form-control" name="{{d.name}}" [(ngmodel)]="model[d.name]" required> <option selected disabled>{{d.placeholder}}</option> <option *ngfor="let b of elencobanche" value="{{b.id}}">{{b.denominazione}}</option> </select> </div>
i'm using angular4
. thanks.
--edit-- found out if delete [(ngmodel)]="model[d.name]"
works fine. hint?
that's how supposed work. attributedisabled
can't choose option.
but add hidden
attribute hide it:
<option value="" selected disabled hidden>{{d.placeholder}}</option>
wiki
Comments
Post a Comment