-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(templates): Support disabled options in select menu. #174
Conversation
Huge +1 to this. |
|
||
if (itemIndex >= 0) { | ||
item = ctrl.items[itemIndex]; | ||
isDisabled = item.disabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having disabled
hardcoded maybe could be better to let user specify it as an expression. Something like this:
<ui-select-choices repeat="person in people" disabled="person.active">
{{person.name}}
</ui-select-choices>
That's a really good call. I’ll add that in. |
@dimirc I've updated this so a user can define a function to trigger the disabled behavior (a la |
@miketierney could you remove dist/ files? since I've been only pushing them in specific commits that are for creating a new release (specially for bower). This change will be preferable be on next release (v0.8 |
@miketierney also if you could rebase/squash the commit will be nice |
ce7e668
to
17ceb65
Compare
17ceb65
to
72254eb
Compare
feat(templates): Support disabled options in select menu.
👍 |
Is there a functional demo of this feature? I can disable at the |
badly need a demo on this feature please.. doen't seem to be working when "disabled:true" attribute is present with the data. |
+1 for example |
Here's a plunk with it working: http://plnkr.co/edit/Jj5l3PBMnGVAdLKjH44I I'll work up a PR with a checked-in version of the demo. |
I've got docs in the wiki already: https://github.com/angular-ui/ui-select/wiki/ui-select-choices#example-disable-choices |
Even better, no PR/checked-in demo necessary. |
OK, thanks, Mike! (It turns out the design was changed to use the |
This is to address #168.