Sasika Miyuran Sasika Miyuran -4 years ago 119
AngularJS Question

How to add search box inside <select> tag with ng-option

I need to add search box inside the select tag with ng-option.

<select class="form-control" ng-model="modelname" ng-options=" as for category in Categories ng-change="getSubCategory()">
<option><--search box should be here--></option>

Answer Source

You can't with standard html. You'll have to create something custom - something along these lines.

<ul class="custom-select">
    <li class="custom-select__option" ng-repeat="$ctrl.options"><input type="search"/></li>

It won't be hard to create, but that's the direction you'll need to go.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download