JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.12.0.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div ng-app="app">
<div ng-controller=mainCtrl ng-cloak>
<input type="text" name="name" id="name" placeholder="test" typeahead="x as x.name for x in list | filter:$viewValue | limitTo:8" ng-model="name" ng-disabled="disable" typeahead-on-select="onSelect($item, $model, $label)"
ng-change="change()">
<p>
{{selected}}
</p>
</div>
</div>
JavaScript
var app = angular.module('app', [ 'ui.bootstrap']);
app.controller('mainCtrl', function($scope, $sce, $q, $http) {
$scope.list = [{id:1, name:"foo"},{id:2, name: "bar"},{id:3,name:"baz"}];
$scope.onSelect = function ($item, $model, $label) {
$scope.selected = $item;
};
$scope.change = function () {
$scope.selected = "";
};
});