lordfriend / nya-bootstrap-select

An AngularJS select replacement which build select like dropdown component with collection and ng-model support
http://nya.io/nya-bootstrap-select/
MIT License
179 stars 81 forks source link

Multiple="false" still enables multiple mode #139

Closed lukee910 closed 8 years ago

lukee910 commented 8 years ago

I'm trying to write a directive which can display both single-selects and multi-selects. Is there a way for me to configure this? What I mean by this is that I want to do this:

<ol class="nya-bs-select ..." ng-model="..." multiple="{{config.multiSelect}}">

I tried it and even with multiple="false", it still enables the multiple mode. In comparison, the disabled attribute has this functionality of being enabled / disabled depending on the value passed. So now two questions:

I took a quick look at the source code and, if this should be changed, this would be the line to change.

lordfriend commented 8 years ago

multiple is a boolean attribute, The presence of the attribute represents the true value, the absence of the attribute represents the false value. So the correct usage is using ngIf or ngSwitch directive to switch between multiple and single selection.

lukee910 commented 8 years ago

It would be nice to have the option to enable / disable the multiple mode by value, but that's just a very minor thing. As this is as it's meant to be, I'm closing this issue.