angular-bootstrap-multiselect icon indicating copy to clipboard operation
angular-bootstrap-multiselect copied to clipboard

Selecting one item automatically selects all.

Open droiddavid opened this issue 8 years ago • 2 comments

<multiselect ng-model="$ctrl.platterFood" options="$ctrl.foodForPlatters" show-search="true" id-prop="id" display-prop="name"></multiselect>

Each time I select a single item from my list, $ctrl.foodForPlatters, which is an array of objects, ALL items become selected. Additionally, on your documentation page, the options is spelled with a capital letter O. Is that intentional? If so, then, what is the options attribute for? Is that where I am supposed to place my data source?

Options: [ "France", "United Kingdom", ... ]

Thanks you for any assistance you can provide.

droiddavid avatar Feb 08 '17 04:02 droiddavid

Hi David, I'm having a similar issue, my model already has some selected items in it (that are present in the options) and my options have the same properties as the model, plus a few more.

andyJSexton avatar May 02 '18 14:05 andyJSexton

I had the same issue and the problem with my code was that I was passing an undefined value to the "id-props" attribute. I'm presuming that you are passing an array of mongodb docs to the 'options' attribute. In that case, 'id-prop' should be '_id'. That did the trick for me :)

leo4llen avatar Aug 29 '18 04:08 leo4llen