-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(autocomplete): add md-require-match validator. #8344
feat(autocomplete): add md-require-match validator. #8344
Conversation
Is there any chance this will be reviewed and accepted? |
@ThomasBurleson Please take a look if you have time - This is a very frequently requested feature and it's quite a simple PR. |
@devversion I agree.....This is a must |
This looks good to me, but I think it would be nice to have a demo to show how it works. I tried to throw one together really fast, but I ran into a few troubles which might have to do with the input container and the ng-messages. @devversion Do you have time to put together a quick demo of how to use this new functionality? |
@topherfangio Definitely yeah. I will provide one tomorrow. |
e372d6c
to
52ff512
Compare
what about this one? |
md-floating-label="Favorite state"> | ||
<md-item-template> | ||
<span md-highlight-text="ctrl.searchText">{{item.display}}</span> | ||
</md-item-template> | ||
<div ng-messages="searchForm.autocompleteField.$error" ng-if="searchForm.autocompleteField.$touched"> | ||
<div ng-message="required">You <b>must</b> have a favorite state.</div> | ||
<div ng-message="md-require-match">You didn't select any favorite state.</div> |
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.
Looks good; thanks for the demo.
Can we just change this text to "Please select an existing state."?
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.
Done!
52ff512
to
9f2cf83
Compare
@ThomasBurleson LGTM 👍 |
This adds a new validator to the autocomplete, which evaluates to false, when there currently is no item selected.
Fixes #2492.