{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/6932","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/6932/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/6932/comments","events_url":"https://api.github.com/repos/angular/angular/issues/6932/events","html_url":"https://github.com/angular/angular/issues/6932","id":131908067,"number":6932,"title":"required validator does not work with number","user":{"login":"fredgate","id":3648269,"avatar_url":"https://avatars.githubusercontent.com/u/3648269?v=3","gravatar_id":"","url":"https://api.github.com/users/fredgate","html_url":"https://github.com/fredgate","followers_url":"https://api.github.com/users/fredgate/followers","following_url":"https://api.github.com/users/fredgate/following{/other_user}","gists_url":"https://api.github.com/users/fredgate/gists{/gist_id}","starred_url":"https://api.github.com/users/fredgate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredgate/subscriptions","organizations_url":"https://api.github.com/users/fredgate/orgs","repos_url":"https://api.github.com/users/fredgate/repos","events_url":"https://api.github.com/users/fredgate/events{/privacy}","received_events_url":"https://api.github.com/users/fredgate/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":24,"created_at":"2016-02-06T22:50:43Z","updated_at":"2016-04-05T00:44:25Z","closed_at":null,"body":"The required validator does not work with a input whose type is number : \r\n`<input type=\"number\" ngControl=\"weight\" />`\r\n```\r\nthis.form = fb.group({\r\n  weight: [\"\", Validators.required]\r\n});\r\n```\r\n\r\nWhen the input is empty, no error appear.\r\n\r\nThe reason is that the NumberValueAccessor selector match the input, and set the value of the Control to a number. If the entered string of the input does not match a number, the value is NaN. This is the case for the empty string.\r\nBut the required validator return a error only if the control value is blank (null or undefined) or is a empty string. This is not the case of any of these two conditions because the NumberValueAccessor set the value to the NaN number.\r\n\r\nThe required validator can not really verify the NaN value because it can appear for empty string, but also for string that are not a number (like 'aaa'). The problem is that the validator can not retrieve the entered string from the control variable."},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/205562063","html_url":"https://github.com/angular/angular/issues/6932#issuecomment-205562063","issue_url":"https://api.github.com/repos/angular/angular/issues/6932","id":205562063,"user":{"login":"DrewynV","id":15723416,"avatar_url":"https://avatars.githubusercontent.com/u/15723416?v=3","gravatar_id":"","url":"https://api.github.com/users/DrewynV","html_url":"https://github.com/DrewynV","followers_url":"https://api.github.com/users/DrewynV/followers","following_url":"https://api.github.com/users/DrewynV/following{/other_user}","gists_url":"https://api.github.com/users/DrewynV/gists{/gist_id}","starred_url":"https://api.github.com/users/DrewynV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrewynV/subscriptions","organizations_url":"https://api.github.com/users/DrewynV/orgs","repos_url":"https://api.github.com/users/DrewynV/repos","events_url":"https://api.github.com/users/DrewynV/events{/privacy}","received_events_url":"https://api.github.com/users/DrewynV/received_events","type":"User","site_admin":false},"created_at":"2016-04-05T00:44:25Z","updated_at":"2016-04-05T00:44:25Z","body":"__________________________________\n\nHi! We just wanted to let you know we receievd your email. Thank you for submitting your request. Our aim is to get back to you within 24 hours at the latest. If you have any additional information to add to your request, please reply to this email.\n\n\nAlso please visit our knowledgebase (http://www.support.magicdust.com.au) to browse for further info, we are adding to it all the time.\n\nOr here is our industry report about the 11 Essentials for a Successful Website (http://www.magicdust.com.au/web-design/.\n\nWe look forward to helping you succeed online.\n\nThanks\n\nThe Team @ Magicdust Digital\n\nhttp://support.magicdust.com.au/\n\nPh (02) 9979 7474\nM-F | 9 am-5:00 pm AEST (AEDT in Summer) excluding Public Holidays\n\n------------------------------------------------------------------------------------------------------------\nThis message was sent to  reply@reply.github.com in reference to Case #166792.\n------------------------------------------------------------------------------------------------------------\n\n\n[[8c67582e5e722681abeb0022e49ef5f2fa97be21-673085458]]"}}