Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular bootstrap typeahead not working with Angular 1.3.0

I have created a small plunker to show that this is not working. Can anyone please help me how to use typeahead with 1.3.0 angularJS /provide alternate solutions. We are using it with angular-bootstrap 0.11.0 and the latest version of bootstrap. Our code heavily relies on ng-messages introduced in 1.3.0

Here is the plunker link

As you can clearly see, the click events, up arrows and down arrows dont work. Adding some code to make SO happy. :)

 <div class="container-fluid" ng-controller="TypeaheadCtrl">
      <h4>Static arrays</h4>
      <pre>Model: {{selected | json}}</pre>
      <input type="text" ng-model="selected" typeahead="state for state in states | filter:$viewValue | limitTo:8" class="form-control" />

    </div>
like image 502
Pradeep Mahdevu Avatar asked Jul 18 '14 12:07

Pradeep Mahdevu


1 Answers

You have three choices currently:

  1. Downgrade angular.js version to 1.3.0-beta.10

    The bug is caused by this ngIf fixed d71df9 which is landed in 1.3.0-beta.11

  2. Downgrade angular-bootstrap version to 0.10.0

    The typeahead directive has started to use ngIf in 0.11.0, so downgrade to 0.10.0 will also works.

  3. Wait for angular-bootstrap 0.12.0

    There is already an open issue #2474 , it's planned to be fixed in 0.12.0

EDIT: It seems the issue has been fixed by this commit a0be450d and landed in 0.11.2.

like image 123
runTarm Avatar answered Oct 22 '22 07:10

runTarm