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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -