angular bootstrap typeahead bug
- by Mohammad Akbari
i use angular bootstrap typeahead (this lib ui-bootstrap-tpls.js
) in my app, when use two typeahead in one scope, only one work well, and other not work,
this is my code
angular.module('plunker', ['ui.bootstrap']);
function TypeaheadCtrl($scope) {
$scope.selected = undefined;
$scope.selected2 = undefined;
$scope.states = ['Alabama', 'Alaska','California', 'Hawaii', 'Wisconsin', 'Wyoming'];
}
<html ng-app="plunker">
<head>
<title></title>
<link href="lib/angular-bootstrap/bootstrap.css" rel="stylesheet" />
<script src="lib/angular/angular.js"></script>
<script src="lib/angular-bootstrap/ui-bootstrap-tpls-0.3.0.min.js"></script>
<script src="app.js"></script>
</head>
<body>
<div class='container-fluid' ng-controller="TypeaheadCtrl">
<pre>Model: {{selected| json}}</pre>
<input type="text" ng-model="selected" typeahead="state for state in states | filter:$viewValue">
<input type="text" ng-model="selected2" typeahead="state for state in states | filter:$viewValue">
</div>
</body>
please check this and help.