{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular.js/pulls/comments/23944375","id":23944375,"diff_hunk":"@@ -1083,7 +1122,130 @@ var DEFAULT_REGEXP = /(\\s+|^)default(\\s+|$)/;\n  * `submit` event. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n  * to have access to the updated model.\n  *\n- * `ngModelOptions` has an effect on the element it's declared on and its descendants.\n+ * The following example shows how to override immediate updates. Changes on the inputs within the\n+ * form will update the model only when the control loses focus (blur event). If `escape` key is\n+ * pressed while the input field is focused, the value is reset to the value in the current model.\n+ *\n+ * <example name=\"ngModelOptions-directive-blur\" module=\"optionsExample\">\n+ *   <file name=\"index.html\">\n+ *     <div ng-controller=\"ExampleController\">\n+ *       <form name=\"userForm\">\n+ *         Name:\n+ *         <input type=\"text\" name=\"userName\"\n+ *                ng-model=\"user.name\"\n+ *                ng-model-options=\"{ updateOn: 'blur' }\"\n+ *                ng-keyup=\"cancel($event)\" /><br />\n+ *\n+ *         Other data:\n+ *         <input type=\"text\" ng-model=\"user.data\" /><br />\n+ *       </form>\n+ *       <pre>user.name = <span ng-bind=\"user.name\"></span></pre>\n+ *     </div>\n+ *   </file>\n+ *   <file name=\"app.js\">\n+ *     angular.module('optionsExample', [])\n+ *       .controller('ExampleController', ['$scope', function($scope) {\n+ *         $scope.user = { name: 'say', data: '' };\n+ *\n+ *         $scope.cancel = function(e) {\n+ *           if (e.keyCode == 27) {\n+ *             $scope.userForm.userName.$rollbackViewValue();\n+ *           }\n+ *         };\n+ *       }]);\n+ *   </file>\n+ *   <file name=\"protractor.js\" type=\"protractor\">\n+ *     var model = element(by.binding('user.name'));\n+ *     var input = element(by.model('user.name'));\n+ *     var other = element(by.model('user.data'));\n+ *\n+ *     it('should allow custom events', function() {\n+ *       input.sendKeys(' hello');\n+ *       input.click();\n+ *       expect(model.getText()).toEqual('say');\n+ *       other.click();\n+ *       expect(model.getText()).toEqual('say hello');\n+ *     });\n+ *\n+ *     it('should $rollbackViewValue when model changes', function() {\n+ *       input.sendKeys(' hello');\n+ *       expect(input.getAttribute('value')).toEqual('say hello');\n+ *       input.sendKeys(protractor.Key.ESCAPE);\n+ *       expect(input.getAttribute('value')).toEqual('say');\n+ *       other.click();\n+ *       expect(model.getText()).toEqual('say');\n+ *     });\n+ *   </file>\n+ * </example>\n+ *\n+ * The next example shows how to debounce model changes. Model will be updated only 1 sec after last change.\n+ * If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty.\n+ *\n+ * <example name=\"ngModelOptions-directive-debounce\" module=\"optionsExample\">\n+ *   <file name=\"index.html\">\n+ *     <div ng-controller=\"ExampleController\">\n+ *       <form name=\"userForm\">\n+ *         Name:\n+ *         <input type=\"text\" name=\"userName\"\n+ *                ng-model=\"user.name\"\n+ *                ng-model-options=\"{ debounce: 1000 }\" />\n+ *         <button ng-click=\"userForm.userName.$rollbackViewValue(); user.name=''\">Clear</button><br />\n+ *       </form>\n+ *       <pre>user.name = <span ng-bind=\"user.name\"></span></pre>\n+ *     </div>\n+ *   </file>\n+ *   <file name=\"app.js\">\n+ *     angular.module('optionsExample', [])\n+ *       .controller('ExampleController', ['$scope', function($scope) {\n+ *         $scope.user = { name: 'say' };\n+ *       }]);\n+ *   </file>\n+ * </example>\n+ *\n+ * ## Model updates and validation\n+ *\n+ * The default behaviour in `ngModel` is that the model value is set to `null` when the validation\n+ * determines that the value is invalid. By setting the `allowInvalid` property to true, the model\n+ * will still be updated even if the value is invalid.\n+ *\n+ *\n+ * ## Connecting to the scope\n+ *\n+ * By setting the `getterSetter` property to true you are telling ngModel that the `ngModel` expression\n+ * on the scope actually refers to a \"getter/setter\" function rather than the actual value itself.","path":"src/ng/directive/ngModel.js","position":248,"original_position":248,"commit_id":"b99916bf96d72e0074e568ab3b04f546764ef744","original_commit_id":"b99916bf96d72e0074e568ab3b04f546764ef744","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},"body":"kind of awkward duplication of \"actually\" and \"actual\". Maybe just get rid of \"actually\"?","created_at":"2015-02-02T18:12:32Z","updated_at":"2015-02-02T18:12:32Z","html_url":"https://github.com/angular/angular.js/pull/10922#discussion_r23944375","pull_request_url":"https://api.github.com/repos/angular/angular.js/pulls/10922","_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments/23944375"},"html":{"href":"https://github.com/angular/angular.js/pull/10922#discussion_r23944375"},"pull_request":{"href":"https://api.github.com/repos/angular/angular.js/pulls/10922"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular.js/pulls/10922","id":28416398,"html_url":"https://github.com/angular/angular.js/pull/10922","diff_url":"https://github.com/angular/angular.js/pull/10922.diff","patch_url":"https://github.com/angular/angular.js/pull/10922.patch","issue_url":"https://api.github.com/repos/angular/angular.js/issues/10922","number":10922,"state":"open","locked":false,"title":"feat(ngModelOptions): allow options to be inherited from ancestors","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},"body":"Previously, you had to apply the complete set of ngModelOptions at every point where\r\nyou might want to modify just one or two settings.\r\n\r\nThis change allows more general settings to be applied at nearer the top of the DOM\r\nand then for more specific settings to override those general settings further down\r\nin the DOM.\r\n\r\n*It should also be noted that this change means that `ctrl.$options` will always reference a valid object\r\nand so a large part of this PR is removing the unnecessary checks for existence of that object.*\r\n\r\nBREAKING CHANGE:\r\n\r\nPreviously, if a setting was not applied on ngModelOptions, then it would default\r\nto undefined. Now the setting will be inherited from the nearest ngModelOptions\r\nancestor.\r\n\r\nIt is possible that an ngModelOptions directive that does not set a property,\r\nhas an ancestor ngModelOptions that does set this property to a value other than\r\nundefined. This would cause the ngModel and input controls below this ngModelOptions\r\ndirective to display different behaviour. This is fixed by explictly setting the\r\nproperty in the ngModelOptions to prevent it from inheriting from the ancestor.","created_at":"2015-01-31T15:42:21Z","updated_at":"2015-02-02T18:12:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a677e9803a16916b52e718357e77cefe68b012d1","assignee":null,"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/84","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/84/labels","id":952460,"number":84,"title":"1.4.0-beta.3 / 1.3.12","description":"","creator":{"login":"caitp","id":2294695,"avatar_url":"https://avatars.githubusercontent.com/u/2294695?v=3","gravatar_id":"","url":"https://api.github.com/users/caitp","html_url":"https://github.com/caitp","followers_url":"https://api.github.com/users/caitp/followers","following_url":"https://api.github.com/users/caitp/following{/other_user}","gists_url":"https://api.github.com/users/caitp/gists{/gist_id}","starred_url":"https://api.github.com/users/caitp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caitp/subscriptions","organizations_url":"https://api.github.com/users/caitp/orgs","repos_url":"https://api.github.com/users/caitp/repos","events_url":"https://api.github.com/users/caitp/events{/privacy}","received_events_url":"https://api.github.com/users/caitp/received_events","type":"User","site_admin":false},"open_issues":26,"closed_issues":8,"state":"open","created_at":"2015-01-27T01:56:57Z","updated_at":"2015-02-02T14:04:11Z","due_on":"2015-02-01T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/angular/angular.js/pulls/10922/commits","review_comments_url":"https://api.github.com/repos/angular/angular.js/pulls/10922/comments","review_comment_url":"https://api.github.com/repos/angular/angular.js/pulls/comments/{number}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/10922/comments","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/b99916bf96d72e0074e568ab3b04f546764ef744","head":{"label":"petebacondarwin:inheritable-ngModelOptions","ref":"inheritable-ngModelOptions","sha":"b99916bf96d72e0074e568ab3b04f546764ef744","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},"repo":{"id":6367749,"name":"angular.js","full_name":"petebacondarwin/angular.js","owner":{"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},"private":false,"html_url":"https://github.com/petebacondarwin/angular.js","description":"","fork":true,"url":"https://api.github.com/repos/petebacondarwin/angular.js","forks_url":"https://api.github.com/repos/petebacondarwin/angular.js/forks","keys_url":"https://api.github.com/repos/petebacondarwin/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/petebacondarwin/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/petebacondarwin/angular.js/teams","hooks_url":"https://api.github.com/repos/petebacondarwin/angular.js/hooks","issue_events_url":"https://api.github.com/repos/petebacondarwin/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/petebacondarwin/angular.js/events","assignees_url":"https://api.github.com/repos/petebacondarwin/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/petebacondarwin/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/petebacondarwin/angular.js/tags","blobs_url":"https://api.github.com/repos/petebacondarwin/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/petebacondarwin/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/petebacondarwin/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/petebacondarwin/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/petebacondarwin/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/petebacondarwin/angular.js/languages","stargazers_url":"https://api.github.com/repos/petebacondarwin/angular.js/stargazers","contributors_url":"https://api.github.com/repos/petebacondarwin/angular.js/contributors","subscribers_url":"https://api.github.com/repos/petebacondarwin/angular.js/subscribers","subscription_url":"https://api.github.com/repos/petebacondarwin/angular.js/subscription","commits_url":"https://api.github.com/repos/petebacondarwin/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/petebacondarwin/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/petebacondarwin/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/petebacondarwin/angular.js/issues/comments/{number}","contents_url":"https://api.github.com/repos/petebacondarwin/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/petebacondarwin/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/petebacondarwin/angular.js/merges","archive_url":"https://api.github.com/repos/petebacondarwin/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/petebacondarwin/angular.js/downloads","issues_url":"https://api.github.com/repos/petebacondarwin/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/petebacondarwin/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/petebacondarwin/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/petebacondarwin/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/petebacondarwin/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/petebacondarwin/angular.js/releases{/id}","created_at":"2012-10-24T09:47:23Z","updated_at":"2015-01-13T00:59:09Z","pushed_at":"2015-02-02T13:31:24Z","git_url":"git://github.com/petebacondarwin/angular.js.git","ssh_url":"git@github.com:petebacondarwin/angular.js.git","clone_url":"https://github.com/petebacondarwin/angular.js.git","svn_url":"https://github.com/petebacondarwin/angular.js","homepage":"http://angularjs.org","size":73828,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"8a2c80ce7ff3f4746123d6b5fdf1fb0e304c91d0","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":460078,"name":"angular.js","full_name":"angular/angular.js","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular.js","description":"HTML enhanced for web apps","fork":false,"url":"https://api.github.com/repos/angular/angular.js","forks_url":"https://api.github.com/repos/angular/angular.js/forks","keys_url":"https://api.github.com/repos/angular/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular.js/teams","hooks_url":"https://api.github.com/repos/angular/angular.js/hooks","issue_events_url":"https://api.github.com/repos/angular/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular.js/events","assignees_url":"https://api.github.com/repos/angular/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular.js/tags","blobs_url":"https://api.github.com/repos/angular/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular.js/languages","stargazers_url":"https://api.github.com/repos/angular/angular.js/stargazers","contributors_url":"https://api.github.com/repos/angular/angular.js/contributors","subscribers_url":"https://api.github.com/repos/angular/angular.js/subscribers","subscription_url":"https://api.github.com/repos/angular/angular.js/subscription","commits_url":"https://api.github.com/repos/angular/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular.js/issues/comments/{number}","contents_url":"https://api.github.com/repos/angular/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular.js/merges","archive_url":"https://api.github.com/repos/angular/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular.js/downloads","issues_url":"https://api.github.com/repos/angular/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular.js/releases{/id}","created_at":"2010-01-06T00:34:37Z","updated_at":"2015-02-02T17:54:05Z","pushed_at":"2015-02-02T17:23:25Z","git_url":"git://github.com/angular/angular.js.git","ssh_url":"git@github.com:angular/angular.js.git","clone_url":"https://github.com/angular/angular.js.git","svn_url":"https://github.com/angular/angular.js","homepage":"http://angularjs.org","size":215022,"stargazers_count":34843,"watchers_count":34843,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13988,"mirror_url":null,"open_issues_count":1094,"forks":13988,"open_issues":1094,"watchers":34843,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/10922"},"html":{"href":"https://github.com/angular/angular.js/pull/10922"},"issue":{"href":"https://api.github.com/repos/angular/angular.js/issues/10922"},"comments":{"href":"https://api.github.com/repos/angular/angular.js/issues/10922/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular.js/pulls/10922/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/angular/angular.js/pulls/10922/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular.js/statuses/b99916bf96d72e0074e568ab3b04f546764ef744"}}}}