{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/11423","labels_url":"https://api.github.com/repos/angular/angular.js/issues/11423/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/11423/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/11423/events","html_url":"https://github.com/angular/angular.js/issues/11423","id":64179751,"number":11423,"title":"ngModel.$setViewValue should return a promise","user":{"login":"wesleycho","id":1703387,"avatar_url":"https://avatars.githubusercontent.com/u/1703387?v=3","gravatar_id":"","url":"https://api.github.com/users/wesleycho","html_url":"https://github.com/wesleycho","followers_url":"https://api.github.com/users/wesleycho/followers","following_url":"https://api.github.com/users/wesleycho/following{/other_user}","gists_url":"https://api.github.com/users/wesleycho/gists{/gist_id}","starred_url":"https://api.github.com/users/wesleycho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesleycho/subscriptions","organizations_url":"https://api.github.com/users/wesleycho/orgs","repos_url":"https://api.github.com/users/wesleycho/repos","events_url":"https://api.github.com/users/wesleycho/events{/privacy}","received_events_url":"https://api.github.com/users/wesleycho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-25T05:27:04Z","updated_at":"2015-03-26T09:26:07Z","closed_at":null,"body":"In the case of a debounced value update, currently `$setViewValue` does not allow the user to detect when the update is truly executed, resulting in a potentially premature call to `$render` - this affects the UI Bootstrap datepicker.  If ngModelOptions has no debounce, it should then resolve immediately.\r\n\r\nThe usage should be promise based, so it can support code like\r\n<pre>\r\nngModel.$setViewValue('foo')\r\n  .then(ngModel.$render);\r\n</pre>"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/86419143","html_url":"https://github.com/angular/angular.js/issues/11423#issuecomment-86419143","issue_url":"https://api.github.com/repos/angular/angular.js/issues/11423","id":86419143,"user":{"login":"Narretz","id":1153097,"avatar_url":"https://avatars.githubusercontent.com/u/1153097?v=3","gravatar_id":"","url":"https://api.github.com/users/Narretz","html_url":"https://github.com/Narretz","followers_url":"https://api.github.com/users/Narretz/followers","following_url":"https://api.github.com/users/Narretz/following{/other_user}","gists_url":"https://api.github.com/users/Narretz/gists{/gist_id}","starred_url":"https://api.github.com/users/Narretz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narretz/subscriptions","organizations_url":"https://api.github.com/users/Narretz/orgs","repos_url":"https://api.github.com/users/Narretz/repos","events_url":"https://api.github.com/users/Narretz/events{/privacy}","received_events_url":"https://api.github.com/users/Narretz/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T09:26:07Z","updated_at":"2015-03-26T09:26:07Z","body":"$setViewValue is generally called after the user changes an input: it extracts the value from the input and sets it on the ngModel. $render needs to be called after the model changes to update the input. \r\nA common problem is that widgets format the $viewValue before it's set on the model, and they want to propagate this change back to the input, and for that they need $render."}}