Feature Request
Ideally when the array that you pass into ngModel on md-select is used in order to select all of the md-option's that match.
Currently no options are selected from the array at all.
Set multiple on your md-select and then pass in a subset of the full list of options to the ngModel on the md-select.
Here is a plunk showing how this behavior doesn't currently work:
http://plnkr.co/edit/aUh0OJUtevRUekcVcovV
My use-case would be that I normally use multiple with md-select but would like to continue to have default values in that form, for cases when a user might be editing pre-existing values.
N/A
It's possible that maybe I'm just doing this wrong? But otherwise I couldn't find documentation to support this use case.
I looked into it @KyleMcNutt. Everything works as expected. Your Plunkr doesn't work, because the items are compared by reference, not by value. Since the value inside the selectedItems isn't a part of the items, it won't be selected. Here's a working version of your Plunkr. There are a couple of ways to work around it:
@crisbeto Sure enough, thanks for the help! This behavior should probably be documented somewhere as to avoid this confusion in the future?
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
I looked into it @KyleMcNutt. Everything works as expected. Your Plunkr doesn't work, because the items are compared by reference, not by value. Since the value inside the
selectedItemsisn't a part of theitems, it won't be selected. Here's a working version of your Plunkr. There are a couple of ways to work around it: