lordfriend/nya-bootstrap-select

data-live-search gives Cannot read property 'options' of undefined

valhallen13 opened this issue · 2 comments

I have some code which gives me the following error every time i try to search through my nya options:

Uncaught TypeError: Cannot read property 'options' of undefined
at HTMLInputElement.keydown (bootstrap-select.js:901)
at HTMLDocument.dispatch (jquery-1.10.0.js:5107)
at HTMLDocument.elemData.handle (jquery-1.10.0.js:4778)

This is my code both html and angular. I use angular 1.5.9. Any idea what might be causing it?

<ol class="nya-bs-select" ng-model="output" data-live-search="true" ng-change="doSomething()">
        <li nya-bs-option="option in options"><a>{{ option.name }}</a></li>
</ol>
$scope.options  = [
  {name: 'Alpha', subtitle: 'Alice', group: 'Group1'},
  {name: 'Bravo', subtitle: 'Bob', group: 'Group2'},
  {name: 'Charlie', subtitle: 'Carl', group: 'Group1'},
  {name: 'Golf', subtitle: 'George', group: 'Group1'},
  {name: 'Hotel', subtitle: 'Harry', group: 'Group1'},
  {name: 'Juliet', subtitle: 'Joe', group: 'Group2'},
  {name: 'Kilo', subtitle: 'Kate', group: 'Group2'},
  {name: 'Lima', subtitle: 'Laura', group: 'Group2'}
];

This error is reported in bootstrap-select.js(which is not a dependency of this directive). You may need to investigate that plugin to figure out what happened.

indeed, it seems to be an old library, and after i took the old library out it worked fine. Thanks!