{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/2574","labels_url":"https://api.github.com/repos/angular/angular.js/issues/2574/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/2574/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/2574/events","html_url":"https://github.com/angular/angular.js/pull/2574","id":13931218,"number":2574,"title":"Extending ng-model to hidden fields","user":{"login":"stsvilik","id":142800,"avatar_url":"https://avatars.githubusercontent.com/u/142800?v=3","gravatar_id":"","url":"https://api.github.com/users/stsvilik","html_url":"https://github.com/stsvilik","followers_url":"https://api.github.com/users/stsvilik/followers","following_url":"https://api.github.com/users/stsvilik/following{/other_user}","gists_url":"https://api.github.com/users/stsvilik/gists{/gist_id}","starred_url":"https://api.github.com/users/stsvilik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stsvilik/subscriptions","organizations_url":"https://api.github.com/users/stsvilik/orgs","repos_url":"https://api.github.com/users/stsvilik/repos","events_url":"https://api.github.com/users/stsvilik/events{/privacy}","received_events_url":"https://api.github.com/users/stsvilik/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/19","html_url":"https://github.com/angular/angular.js/milestones/Post-1.2","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/19/labels","id":391646,"number":19,"title":"Post-1.2","description":"Features to land after 1.2 has been released","creator":{"login":"jeffbcross","id":463703,"avatar_url":"https://avatars.githubusercontent.com/u/463703?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbcross","html_url":"https://github.com/jeffbcross","followers_url":"https://api.github.com/users/jeffbcross/followers","following_url":"https://api.github.com/users/jeffbcross/following{/other_user}","gists_url":"https://api.github.com/users/jeffbcross/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbcross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbcross/subscriptions","organizations_url":"https://api.github.com/users/jeffbcross/orgs","repos_url":"https://api.github.com/users/jeffbcross/repos","events_url":"https://api.github.com/users/jeffbcross/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbcross/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":25,"state":"closed","created_at":"2013-07-31T22:04:29Z","updated_at":"2013-11-22T10:31:43Z","due_on":null,"closed_at":"2013-11-22T10:31:43Z"},"comments":28,"created_at":"2013-05-03T11:48:34Z","updated_at":"2015-03-09T12:44:30Z","closed_at":"2013-10-01T07:41:20Z","pull_request":{"url":"https://api.github.com/repos/angular/angular.js/pulls/2574","html_url":"https://github.com/angular/angular.js/pull/2574","diff_url":"https://github.com/angular/angular.js/pull/2574.diff","patch_url":"https://github.com/angular/angular.js/pull/2574.patch"},"body":"Hidden fields need to be able to set ng-model too. A good use case would be a hybrid solution such as MVC.net where forms are still submitted to the server (instead of pure AJAX post)"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/77846367","html_url":"https://github.com/angular/angular.js/pull/2574#issuecomment-77846367","issue_url":"https://api.github.com/repos/angular/angular.js/issues/2574","id":77846367,"user":{"login":"petebacondarwin","id":15655,"avatar_url":"https://avatars.githubusercontent.com/u/15655?v=3","gravatar_id":"","url":"https://api.github.com/users/petebacondarwin","html_url":"https://github.com/petebacondarwin","followers_url":"https://api.github.com/users/petebacondarwin/followers","following_url":"https://api.github.com/users/petebacondarwin/following{/other_user}","gists_url":"https://api.github.com/users/petebacondarwin/gists{/gist_id}","starred_url":"https://api.github.com/users/petebacondarwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petebacondarwin/subscriptions","organizations_url":"https://api.github.com/users/petebacondarwin/orgs","repos_url":"https://api.github.com/users/petebacondarwin/repos","events_url":"https://api.github.com/users/petebacondarwin/events{/privacy}","received_events_url":"https://api.github.com/users/petebacondarwin/received_events","type":"User","site_admin":false},"created_at":"2015-03-09T12:44:30Z","updated_at":"2015-03-09T12:44:30Z","body":"Most of the use cases I have seen so far in this thread are using the hidden input as some interface to 3rd party code, which updates the value of the hidden input in some way, and that people expect `ngModel` to deal with this and make that value appear on the scope. `ngModel` listens in to DOM events like `change`, `blur` and `keydown` to trigger updates to the `$viewValue` and so to the value on the scope.\r\n\r\nThe question that occurs to me is how is Angular supposed to be aware of this change on a hidden input?\r\n\r\nIn the scenarios discussed in this issue, I don't believe that the hidden input element is going to trigger any particular DOM event just because another piece of code updates its value. One needs to look at that particular 3rd party code, on a case by case basis, and create a directive that will connect to the relevant event or callback.\r\n\r\nI think we should put in place an error message if you try to use `ngModel` on a hidden input, which links to documentation about how to bind data \"one way\" for form submission and also advice on how one might connect to a 3rd party library that happens to update hidden inputs.  What do you think @caitp?"}}