{"action":"created","issue":{"url":"https://api.github.com/repos/AngularClass/angular2-hmr/issues/27","repository_url":"https://api.github.com/repos/AngularClass/angular2-hmr","labels_url":"https://api.github.com/repos/AngularClass/angular2-hmr/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/AngularClass/angular2-hmr/issues/27/comments","events_url":"https://api.github.com/repos/AngularClass/angular2-hmr/issues/27/events","html_url":"https://github.com/AngularClass/angular2-hmr/issues/27","id":180158396,"number":27,"title":"Input restoration","user":{"login":"mattdistefano","id":6283349,"avatar_url":"https://avatars.githubusercontent.com/u/6283349?v=3","gravatar_id":"","url":"https://api.github.com/users/mattdistefano","html_url":"https://github.com/mattdistefano","followers_url":"https://api.github.com/users/mattdistefano/followers","following_url":"https://api.github.com/users/mattdistefano/following{/other_user}","gists_url":"https://api.github.com/users/mattdistefano/gists{/gist_id}","starred_url":"https://api.github.com/users/mattdistefano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattdistefano/subscriptions","organizations_url":"https://api.github.com/users/mattdistefano/orgs","repos_url":"https://api.github.com/users/mattdistefano/repos","events_url":"https://api.github.com/users/mattdistefano/events{/privacy}","received_events_url":"https://api.github.com/users/mattdistefano/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-29T20:45:54Z","updated_at":"2016-11-03T12:04:46Z","closed_at":null,"body":"Was looking over this code...\n\n``` javascript\nexport function getInputValues() {\n  const inputs = document.querySelectorAll('input');\n  return Array.prototype.slice.call(inputs).map(input => input.value);\n}\n\nconst inputs = document.querySelectorAll('input');\n  if ($inputs && inputs.length === $inputs.length) {\n    $inputs.forEach((value, i) => {\n      const el: any = inputs[i];\n      el.value = value;\n      el.dispatchEvent(new CustomEvent('input', {detail: el.value}));\n    });\n  }\n```\n\nAnd a couple things came to mind:\n1. The `input` selector won't pick up select menus or textareas\n2. However, it _will_ pick up radios and checkboxes, but the `value` property of a checkbox or radio typically isn't as important as its `checked` property\n3. checkboxes and radios I believe likewise fire a `change` event rather than an `input` event\n4. `CustomEvent` IIRC is not supported without a polyfill on IE11 or earlier. Probably not a big deal for development but might be worth mentioning in the README\n"},"comment":{"url":"https://api.github.com/repos/AngularClass/angular2-hmr/issues/comments/258124891","html_url":"https://github.com/AngularClass/angular2-hmr/issues/27#issuecomment-258124891","issue_url":"https://api.github.com/repos/AngularClass/angular2-hmr/issues/27","id":258124891,"user":{"login":"gdi2290","id":1016365,"avatar_url":"https://avatars.githubusercontent.com/u/1016365?v=3","gravatar_id":"","url":"https://api.github.com/users/gdi2290","html_url":"https://github.com/gdi2290","followers_url":"https://api.github.com/users/gdi2290/followers","following_url":"https://api.github.com/users/gdi2290/following{/other_user}","gists_url":"https://api.github.com/users/gdi2290/gists{/gist_id}","starred_url":"https://api.github.com/users/gdi2290/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdi2290/subscriptions","organizations_url":"https://api.github.com/users/gdi2290/orgs","repos_url":"https://api.github.com/users/gdi2290/repos","events_url":"https://api.github.com/users/gdi2290/events{/privacy}","received_events_url":"https://api.github.com/users/gdi2290/received_events","type":"User","site_admin":false},"created_at":"2016-11-03T12:04:46Z","updated_at":"2016-11-03T12:04:46Z","body":"@mattdistefano an you make a PR to update the logic?"}}
{"actor":{"display_login":"gdi2290"}}