I have an ui-select
which is wrapped in ng-repeat
directive. Since they share the same scope I have several problems:
after selecting value in first select second select is already prefilled with what I typed in first.
placeholder is hidden and shows only when select field is in focus.
Here is the html:
<div ng-repeat="repeat in repeats">
<p>Selected: {{repeat.id.formatted_address}}</p>
<ui-select ng-model="repeat.id"
theme="bootstrap"
ng-disabled="disabled"
reset-search-input="false"
style="width: 300px;">
<ui-select-match placeholder="Enter an address...">{{$select.selected.formatted_address}}</ui-select-match>
<ui-select-choices repeat="address in addresses track by $index"
refresh="refreshAddresses($select.search)"
refresh-delay="0">
<div ng-bind-html="address.formatted_address | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
</div>
The question is what is the proper way to use several ui-select
directives to prevent those issues?