{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/11360","labels_url":"https://api.github.com/repos/angular/angular.js/issues/11360/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/11360/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/11360/events","html_url":"https://github.com/angular/angular.js/issues/11360","id":62717110,"number":11360,"title":"ngSubmit does not update model before submit","user":{"login":"sajal","id":25007,"avatar_url":"https://avatars.githubusercontent.com/u/25007?v=3","gravatar_id":"","url":"https://api.github.com/users/sajal","html_url":"https://github.com/sajal","followers_url":"https://api.github.com/users/sajal/followers","following_url":"https://api.github.com/users/sajal/following{/other_user}","gists_url":"https://api.github.com/users/sajal/gists{/gist_id}","starred_url":"https://api.github.com/users/sajal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sajal/subscriptions","organizations_url":"https://api.github.com/users/sajal/orgs","repos_url":"https://api.github.com/users/sajal/repos","events_url":"https://api.github.com/users/sajal/events{/privacy}","received_events_url":"https://api.github.com/users/sajal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-18T15:06:45Z","updated_at":"2015-03-18T15:06:45Z","closed_at":null,"body":"When using `ngModelOptions` to update only on blur, submitting the form without loosing focus does not take freshly validated data into account.\r\n\r\nI am updating on blur because i dont want to annoy user while they type, also my intention is to use http for validation and don't want to fire too many ajax calls.\r\n\r\nexample: http://jsfiddle.net/ms5uxw12/1/\r\n\r\nreproduce:\r\n1. Select the textbox, enter valid data (lowercase alpha only minimum 3 characters).\r\n2. Without loosing focus, click submit\r\n\r\nalternatively:\r\n1. Fill numbers in textbox\r\n2. Leave focus, you should see error message.\r\n3. Replace numbers with alpha, click submit without leaving focus of textbox.\r\n\r\nThe `$scope.something.$valid` test does not pass because the form gets submitted before the models gets re-validated.\r\n\r\nhttps://docs.angularjs.org/api/ng/directive/ngModelOptions - \"Any pending changes will take place immediately when an enclosing form is submitted via the submit event. Note that ngClick events will occur before the model is updated. Use ngSubmit to have access to the updated model.\"\r\n\r\n\r\n"}}