{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/material/issues/10231","repository_url":"https://api.github.com/repos/angular/material","labels_url":"https://api.github.com/repos/angular/material/issues/10231/labels{/name}","comments_url":"https://api.github.com/repos/angular/material/issues/10231/comments","events_url":"https://api.github.com/repos/angular/material/issues/10231/events","html_url":"https://github.com/angular/material/issues/10231","id":199248754,"number":10231,"title":"datepicker does not reset $modelValue to null when invalid - this means ng-change doesn't fire either","user":{"login":"johnjesse","id":6839660,"avatar_url":"https://avatars.githubusercontent.com/u/6839660?v=3","gravatar_id":"","url":"https://api.github.com/users/johnjesse","html_url":"https://github.com/johnjesse","followers_url":"https://api.github.com/users/johnjesse/followers","following_url":"https://api.github.com/users/johnjesse/following{/other_user}","gists_url":"https://api.github.com/users/johnjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjesse/subscriptions","organizations_url":"https://api.github.com/users/johnjesse/orgs","repos_url":"https://api.github.com/users/johnjesse/repos","events_url":"https://api.github.com/users/johnjesse/events{/privacy}","received_events_url":"https://api.github.com/users/johnjesse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-06T17:43:56Z","updated_at":"2017-01-06T17:43:56Z","closed_at":null,"body":"**Actual Behavior**:\r\n -  `What is the issue? *`\r\n\r\nthe datepicker does not reset the $modelValue to null when the input is invalid. I think this is because it uses $setValidity instead of registering validators. Importantly this is opposite to how angular normally behaves.\r\n\r\nAs it doesn't reset the model value then ng-change events don't fire, normally they do fire when you move form a valid to an invalid modelValue.\r\n\r\n -  `What is the expected behavior?`\r\n\r\nThe $modelValue should be set to null\r\n\r\n**CodePen** (or steps to reproduce the issue): *\r\n -  `CodePen Demo which shows your issue:`\r\n\r\nhttp://codepen.io/anon/pen/OWVbNP\r\n -  `Details:`\r\n\r\nenter a valid date e.g. 1/1/1 - the model value updates accordingly\r\nchange date to invalid e.g. 2001/20001/20001 - the model value stays the same as it was before\r\n\r\ncompare this to the input box\r\n\r\nenter a valid number e.g. 1 - the model value is 1\r\nchange to an invalid number e.g. -1 - the model value is reset to null\r\n\r\n**Angular Versions**: *\r\n -  `Angular Version:`1.5.8\r\n -  `Angular Material Version:`1.1.1\r\n\r\n**Additional Information**:\r\n -  `Browser Type: *` Chrome\r\n -  `Browser Version: *`\r\n -  `OS: *` Windows\r\n -  `Stack Traces:`\r\n\r\n----\r\nShortcut to create a [new CodePen Demo](http://codepen.io/team/AngularMaterial/pen/bEGJdd).\r\nNote: `*` indicates required information. Without this information, your issue may be auto-closed.\r\n\r\n> Do not modify the titles or questions. Simply add your responses to the ends of the questions.\r\n  Add more lines if needed."}}
{"actor":{"display_login":"johnjesse"}}