This repository was archived by the owner on Oct 2, 2019. It is now read-only.
Proposal of a way to change the class and style of tags, selected choice and available choices#2007
Open
aurelienlt wants to merge 2 commits intoangular-ui:masterfrom
Open
Proposal of a way to change the class and style of tags, selected choice and available choices#2007aurelienlt wants to merge 2 commits intoangular-ui:masterfrom
aurelienlt wants to merge 2 commits intoangular-ui:masterfrom
Conversation
…le in order to customize results
Author
|
I have improved the merging of user classes and default classes: it is especially now fully compatible with ng-class attribute style, and default classes can be disabled. I've updated my plunkr with the new features: http://plnkr.co/edit/gq04wJ9C0iaaLA87Pfxg?p=preview |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Despite having been discussed, no way to change tag colors has never been implemented yet. Therefore I've implemented a method for my usage, and tried to make it as generic and simple as possible. Here is my proposal.
I've created 4 new attributes:
ui-match-classandui-match-stylein<ui-select-match>in order to change the class and style of the tags (multiple case) or the selected choice (single case). They can use the scope variables$match.activeand$match.lockedto have a more flexible behavior.ui-choice-classandui-choice-stylein<ui-select-choice>in order to change the class and style of the available choices. They can use the scope variables$choice.activeand$choice.disabledto have a more flexible behavior.It is totally retro-compatible (the behavior is unchanged if they are absent), and compatible with every theme (except for the selected choice with the serialize theme). It is especially largely compatible with bootstrap tags, with whom the
btn-xxxclasses can be used. It is from far simple enough for most usages.All features can be tested in this plunkr: http://plnkr.co/edit/gq04wJ9C0iaaLA87Pfxg