user3648646 user3648646 - 2 years ago 417
AngularJS Question

Clear icon inside ui.bootstrap.typeahead

I am using an angular UI typeahead from Angular bootstrap UI

I would like to be able to clear the selection using an icon in the textbox like below

| X|

I have tried using input type search but that didn't work.
my code:

<input type="text" ng-model="search" placeholder="Search"
uib-typeahead="eachCatigory in catigories | limitTo:8"/>

Any suggestions are great.

Answer Source

<div class='input-group'>
  <input type="text"
         uib-typeahead="state for state in states"
         class="form-control" />
  <span class="input-group-addon"

Modified version that has the X just overlaid on the text box (using relative and absolute positioning)

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