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

Clear input and data selected after click item #243

Closed rmdevelopers closed 6 years ago

rmdevelopers commented 7 years ago
<input ng2-auto-complete 
            #refrence                                  <--  
                    type="text"
                    value-property-name="id"
                    display-property-name="name"
                    [list-formatter]="autocompleListFormatter"
                    [source]="arrProdutos"
            max-num-list="5"        
            (click)="refrence.value=null"       <--         
                    (valueChanged)="valueChanged($event)"                                       
                    placeholder="Name product"/>      

The input been cleaned but list formatter saved text remains...

atanu21000 commented 6 years ago

+1

atanu21000 commented 6 years ago

I add a blank option for show a blank row to clear input data. But do not like this solution.

blank-option-text="(clear)"

ghost commented 5 years ago

Not a better solution yet ? @almothafar