Multiple="false" still enables multiple mode
lukee910 opened this issue · 2 comments
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:
- Is this behaviour correct?
- Is there a way to "toggle" multiple mode via JS (preferably without using jQuery)?
I took a quick look at the source code and, if this should be changed, this would be the line to change.
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.
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.