I am looking for a way to create combobox (entering text and a dropdown in one). The text field should be attached to the model value, as if it were regular text input, but at the same time it should be possible to select a value from the drop-down list that will be set as text.
I tried angular -ui-select ( https://github.com/angular-ui/ui-select ) but could not get the required functionality. This is either a text box, or only allows you to select from the drop-down list. My user should be able to enter custom text or select from a drop-down list.
I tried with the code below, which, of course, does not work, since my element.customType model is installed only after the value is selected from the drop-down list. Does anyone know how this can be achieved using ui-select or perhaps another directive?
<ui-select ng-model="element.customType" theme="bootstrap" ng-disabled="disabled" style="min-width: 300px;">
<ui-select-match placeholder="Enter customType...">{{$select.selected}}</ui-select-match>
<ui-select-choices repeat="type in CUSTOM_TYPES">
<div ng-bind-html="trustAsHtml(type)"></div>
</ui-select-choices>
</ui-select>
Any help is appreciated.
jimmy source
share