isteven / angular-multi-select

A multi select dropdown directive for AngularJS. Allows you to use HTML tags and CSS in the data. Requires only AngularJS and nothing else.
isteven.github.io/angular-multi-select
MIT License
1.08k stars 518 forks source link

How to prevent .length == 'undefined' error when populating dropdown via on-open #569

Open sterichards opened 5 years ago

sterichards commented 5 years ago

I'm dynamically loading the data into the dropdown upon a user opening a dropdown

I use on-open="loadDataIntoDropdown()" and it works great but it throws up the following error into the console:

angular.js:12520 TypeError: Cannot read property 'length' of undefined at Scope.$scope.refreshButton (isteven-multi-select.js:521)