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

angular.js:13920 TypeError: Cannot read property 'length' of undefined #481

Closed palerique closed 7 years ago

palerique commented 8 years ago

I have installed the component via bower using the version 4.0.0.

The component was rendered but when I click in the button to see the options the error bellow occurs:

angular.js:13920 TypeError: Cannot read property 'length' of undefined at Scope.link.$scope.refreshButton (isteven-multi-select.js:521) at fn (eval at compile (angular.js:14817), :4:980) at expensiveCheckFn (angular.js:15906) at callback (angular.js:25885) at Scope.$eval (angular.js:17682) at Scope.$apply (angular.js:17782) at HTMLButtonElement. (angular.js:25890) at HTMLButtonElement.dispatch (jquery.js:4435) at HTMLButtonElement.elemData.handle (jquery.js:4121)

I'm using the array of objects, exactly like the quick start instruct. But I'm using the variable in the context of controller instead of in the $scope. I also tried to put the variable in $scope but had the same result!

My AngularJS version is above 1.5 and I'm using chrome to test!

I tried these two flavors with the same result:

    <div
      isteven-multi-select
      input-model="modal.modernBrowsers"
      output-model="modal.outputBrowsers"
      button-label="icon name"
      item-label="icon name maker"
      tick-property="ticked"
    >
    </div>

    <isteven-multi-select
      input-model="modal.modernBrowsers"
      output-model="modal.outputBrowsers"
      button-label="icon name"
      item-label="icon name maker"
      tick-property="ticked"
    >
    </isteven-multi-select>

How can I solve that problem???

Thank you very much! PH

palerique commented 8 years ago

Please, disregard that Issue! My bad!

I have used another controller :-(