Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat(select): ngOptions support disabling options #9854

Closed
wants to merge 1 commit into from

Conversation

cades
Copy link

@cades cades commented Oct 31, 2014

Extend the ngOptions DSL to support disabling options. Since
elements are generated by ngOptions, we cannot use ngDisabled in this
scenario. Via extend the DSL, user have control over if a option
is diabled on arbitrary condition.

This commit insert a disable if cond match syntax into
NG_OPTIONS_REGEXP, change other match index accordingly, add disabled
attribute to null option element and newly cloned option elements,
add 2 new unit tests, and change docs as well.

Closes #638

Extend the ngOptions DSL to support disabling options. Since <option>
elements are generated by ngOptions, we cannot use ngDisabled in this
scenario. Via extend the DSL, user have control over if a option
is diabled on arbitrary condition.

This commit insert a `disable if cond` match syntax into
NG_OPTIONS_REGEXP, change other match index accordingly, add disabled
attribute to null option element and newly cloned option elements,
add 2 new unit tests, and change docs as well.

Closes angular#638
@cades
Copy link
Author

cades commented Nov 9, 2014

Hello angular team:
Would you review this PR and give me some feedback? I'm happy to hear any suggestion from you!

@pkozlowski-opensource
Copy link
Member

@cades thnx for the patch. It looks good after very first quick look and it adds support for something that was long requested so we should spend more time reviewing it and eventually landing. Personally I would like to see more tests, for example - how disabled / enabled state changes in response to model changes.

@petebacondarwin
Copy link
Contributor

Closing in favour of #11017 - thanks for the work @cades.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support disabling options in select with ng:options
4 participants