{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/8069","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/8069/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/8069/comments","events_url":"https://api.github.com/repos/angular/angular/issues/8069/events","html_url":"https://github.com/angular/angular/pull/8069","id":148400819,"number":8069,"title":"fix(Control): Support <select multiple> with Control class","user":{"login":"nhydock","id":316728,"avatar_url":"https://avatars.githubusercontent.com/u/316728?v=3","gravatar_id":"","url":"https://api.github.com/users/nhydock","html_url":"https://github.com/nhydock","followers_url":"https://api.github.com/users/nhydock/followers","following_url":"https://api.github.com/users/nhydock/following{/other_user}","gists_url":"https://api.github.com/users/nhydock/gists{/gist_id}","starred_url":"https://api.github.com/users/nhydock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhydock/subscriptions","organizations_url":"https://api.github.com/users/nhydock/orgs","repos_url":"https://api.github.com/users/nhydock/repos","events_url":"https://api.github.com/users/nhydock/events{/privacy}","received_events_url":"https://api.github.com/users/nhydock/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/cla:%20yes","name":"cla: yes","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-14T15:36:35Z","updated_at":"2016-04-18T04:12:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/angular/angular/pulls/8069","html_url":"https://github.com/angular/angular/pull/8069","diff_url":"https://github.com/angular/angular/pull/8069.diff","patch_url":"https://github.com/angular/angular/pull/8069.patch"},"body":"* **Please check if the PR fulfills these requirements**\r\n- [ ] The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format\r\n- [ ] Tests for the changes have been added (for bug fixes / features)\r\n- [ ] Docs have been added / updated (for bug fixes / features)\r\n\r\n\r\n* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)\r\nBug fix for select controls (#4427)\r\n\r\n\r\n* **What is the current behavior?** (You can also link to an open issue here)\r\nSelect currently only supports single option selection.\r\n\r\n\r\n* **What is the new behavior (if this is a feature change)?**\r\nModify change listening to making use of selectOptions on both single and multiple selects.  Using this read-only property, we're able to always get an array of any and all selected options (on single selects it just returns an array with the single option selected).\r\n\r\n\r\n* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?)\r\nNo, it only adds functionality\r\n\r\n\r\n* **Other information**:\r\nChecks are in place to detect if the select is of type multiple to prevent taking the slow execution option on single selects.  Multiple selects require iterating over the whole list to select and unselect the appropriate options when the model changes and invokes a writeValue on the accessor.  It might be worth looking into optimizing this for larger dataset support. "},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/211192446","html_url":"https://github.com/angular/angular/pull/8069#issuecomment-211192446","issue_url":"https://api.github.com/repos/angular/angular/issues/8069","id":211192446,"user":{"login":"nhydock","id":316728,"avatar_url":"https://avatars.githubusercontent.com/u/316728?v=3","gravatar_id":"","url":"https://api.github.com/users/nhydock","html_url":"https://github.com/nhydock","followers_url":"https://api.github.com/users/nhydock/followers","following_url":"https://api.github.com/users/nhydock/following{/other_user}","gists_url":"https://api.github.com/users/nhydock/gists{/gist_id}","starred_url":"https://api.github.com/users/nhydock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhydock/subscriptions","organizations_url":"https://api.github.com/users/nhydock/orgs","repos_url":"https://api.github.com/users/nhydock/repos","events_url":"https://api.github.com/users/nhydock/events{/privacy}","received_events_url":"https://api.github.com/users/nhydock/received_events","type":"User","site_admin":false},"created_at":"2016-04-18T04:12:32Z","updated_at":"2016-04-18T04:12:32Z","body":"If it's decided that it's more ideal to have a single accessor not have two functionally different ways to resolve its value based on an attribute that acts as a flag, I can easily separate out the multiple handling functionality into a separate accessor and make the selectors more specific to prevent collisions. "}}