Dropdown with textbox using ui-select in angular js

4336 views angularjs
-3

I am looking for dropdown with textbox in angularJS. Currently I am using tag. I have filter condition also. Not sure how to save the user typed value.

      <span>
            <ui-select
            ng-model="ele.test"
            theme="selectize"
            class="form-select-control select-dropdown-fixed-position"
            
            name="test"
            ng-change="someEvent(ele)"
            ng-model-options="{ updateOn : 'default blur' }">
                <ui-select-match
                    placeholder="Test">{{$select.selected}}</ui-select-match>
                    <ui-select-choices
                            repeat="test in testList| filter: $select.search">
                        <span ng-bind-html="test | highlight: $select.search"></span>
                    </ui-select-choices>
            </ui-select>
        </span>

If user enters any value other than the values listed in dropdown I have to save it. I have tried with tag but it didn't work.

Any help is appreciated.

answered question

1 Answer

4

You can save it by using the value of $scope.ele.test which holds the value of the entered text.

var myVal = $scope.ele.test;

posted this

Have an answer?

JD

Please login first before posting an answer.