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

How to clean selected data? #256

Closed vicabelotelova closed 7 years ago

vicabelotelova commented 7 years ago

# i have this input

<div class="form-group col-md-6" >
           <input ngui-auto-complete
            [source]="RegionsArray"
            [max-num-list]="10"
            [list-formatter]="autocompleListFormatter"
            (valueChanged)="searchCitiesInBase($event)"
            value-property-name="OCATD"
            display-property-name="FullName"
            class="form-control"
           />
</div> 

# How to clean selected data if i will change another ngui-auto-complete input # And how i can paste my value from json to ngui-auto-complete input i couldn't found some information about this

allenhwkim commented 7 years ago

I do not fully understand your issue. Please create a plunker example and explain what you expect and what actually happening

vicabelotelova commented 7 years ago

@allenhwkim When I change the value in the "country" field, I need to clear the selected value in the "city" field http://embed.plnkr.co/sG4bCHVdcKawJAZS5fNU/

When using the NgModel, you must specify a name. Will it be ignored when submitting the form?

allenhwkim commented 7 years ago

Please re-assign the value when the value is selected using valueChanged or ngModelChange

submit is out of the scope.

vicabelotelova commented 7 years ago

@allenhwkim thank you it's working