ng2-ui / auto-complete

Angular Auto Complete component and directive
https://ng2-ui.github.io/dist/#/auto-complete
MIT License
279 stars 123 forks source link

Input show 'undefined' on open form #236

Closed josecarlosweb closed 6 years ago

josecarlosweb commented 7 years ago

Hello,

I try use on my form like this:

<input id="contato-primario" type="text" class="validate"
                   auto-complete [source]="fonteContatos" placeholder="Contato Primário" [ngModel]="conta.contatoPrimario"
                   [list-formatter]="formatterListContato" display-property-name="nome"  (valueChanged)="valueChanged($event)"
                   value="{{conta.contatoPrimario.nome}}" name="contatoPrimario">

On start the form, the input show "undefined" or when it's empty. I tried to change the value of the attribute to empty, but it did not work.

I just need that input is clear on show empty form.

Sorry if not suitable place for ask here.

taiducnguyen commented 7 years ago

Hi Jose,

Try to use value-formatter and return a string value , this works for me