{"action":"created","issue":{"url":"https://api.github.com/repos/formly-js/angular-formly/issues/574","labels_url":"https://api.github.com/repos/formly-js/angular-formly/issues/574/labels{/name}","comments_url":"https://api.github.com/repos/formly-js/angular-formly/issues/574/comments","events_url":"https://api.github.com/repos/formly-js/angular-formly/issues/574/events","html_url":"https://github.com/formly-js/angular-formly/issues/574","id":120586053,"number":574,"title":"resetModel() does not reset the $pristine and $dirty flag on the main form","user":{"login":"abhisheksaraiya","id":7473179,"avatar_url":"https://avatars.githubusercontent.com/u/7473179?v=3","gravatar_id":"","url":"https://api.github.com/users/abhisheksaraiya","html_url":"https://github.com/abhisheksaraiya","followers_url":"https://api.github.com/users/abhisheksaraiya/followers","following_url":"https://api.github.com/users/abhisheksaraiya/following{/other_user}","gists_url":"https://api.github.com/users/abhisheksaraiya/gists{/gist_id}","starred_url":"https://api.github.com/users/abhisheksaraiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhisheksaraiya/subscriptions","organizations_url":"https://api.github.com/users/abhisheksaraiya/orgs","repos_url":"https://api.github.com/users/abhisheksaraiya/repos","events_url":"https://api.github.com/users/abhisheksaraiya/events{/privacy}","received_events_url":"https://api.github.com/users/abhisheksaraiya/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/formly-js/angular-formly/labels/needs%20investigation","name":"needs investigation","color":"bfd4f2"},{"url":"https://api.github.com/repos/formly-js/angular-formly/labels/waiting%20to%20hear%20back","name":"waiting to hear back","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-05T20:42:06Z","updated_at":"2015-12-05T21:31:14Z","closed_at":null,"body":"Calling resetModel() on the options resets the field $pristine and $untouched values on each field nicely but the $pristine on the main form is left unchanged. Is there a reason why these are left out in the resetModel call?"},"comment":{"url":"https://api.github.com/repos/formly-js/angular-formly/issues/comments/162249417","html_url":"https://github.com/formly-js/angular-formly/issues/574#issuecomment-162249417","issue_url":"https://api.github.com/repos/formly-js/angular-formly/issues/574","id":162249417,"user":{"login":"abhisheksaraiya","id":7473179,"avatar_url":"https://avatars.githubusercontent.com/u/7473179?v=3","gravatar_id":"","url":"https://api.github.com/users/abhisheksaraiya","html_url":"https://github.com/abhisheksaraiya","followers_url":"https://api.github.com/users/abhisheksaraiya/followers","following_url":"https://api.github.com/users/abhisheksaraiya/following{/other_user}","gists_url":"https://api.github.com/users/abhisheksaraiya/gists{/gist_id}","starred_url":"https://api.github.com/users/abhisheksaraiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhisheksaraiya/subscriptions","organizations_url":"https://api.github.com/users/abhisheksaraiya/orgs","repos_url":"https://api.github.com/users/abhisheksaraiya/repos","events_url":"https://api.github.com/users/abhisheksaraiya/events{/privacy}","received_events_url":"https://api.github.com/users/abhisheksaraiya/received_events","type":"User","site_admin":false},"created_at":"2015-12-05T21:31:14Z","updated_at":"2015-12-05T21:31:14Z","body":"Here are the steps to reproduce the issue:\r\nhttp://jsbin.com/jonocawunu/edit?html,js,output\r\n\r\n1) In the beginging when the page is loaded in jsbin, please note the values $pristine and $dirty for FORM with name : \"vm.form\". \r\nThey would be \r\nValues for FORM:\r\n\t\"$dirty\": false,\r\n \t\"$pristine\": true,\r\nValues for input field:\r\n\t\"$dirty\": false,\r\n \t\"$pristine\": true,\r\n    \r\n2) Now if you write anything in the input box in the form the values will change to \r\nValues for FORM:\r\n  \t\"$dirty\": true,\r\n  \t\"$pristine\": false,\r\nValues for input field:\r\n\t\"$dirty\": true,\r\n    \"$pristine\": false,\r\n\r\n This is OK!\r\n\r\n3) Now when you click on reset button (thus calling resetModel()), the values change to:\r\nValues for FORM:\r\n \t \"$dirty\": true,\r\n \t \"$pristine\": false,\r\nValues for input field:\r\n\t\"$dirty\": false,\r\n    \"$pristine\": true,\r\n\r\n The issue is that after resetModel is called, the values for the input field are reset as expected but for the form ($pristine,$dirty) are not reset!"}}