kbanman / selectize-ng

Selectize directive for AngularJS with two-way bindings for both values and options
MIT License
19 stars 7 forks source link

Spurious, untraceable error in console #9

Open smlombardi opened 9 years ago

smlombardi commented 9 years ago

I have a project with selectize-ng menus. One one page, no issues. On another page, I'm getting this error (although the menu itself is working and populated):

TypeError: Cannot read property 'name' of undefined
    at a.extend.addOption (selectize-ng.min.js:2)
    at l (selectize-ng.min.js:5)
    at Object.fn (angular.min.js:120)
    at k.$digest (angular.min.js:122)
    at k.$apply (angular.min.js:125)
    at n (angular.min.js:80)
    at O (angular.min.js:84)
    at XMLHttpRequest.B.onload (angular.min.js:85)

See http://stackoverflow.com/questions/29222526/angular-js-selectize-error for full code.

rcollette commented 9 years ago

You have to have at least an empty array of options. If the bound options is null you will get this.