{"action":"created","issue":{"url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/82","labels_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/82/comments","events_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/82/events","html_url":"https://github.com/offirgolan/ember-cp-validations/pull/82","id":118119160,"number":82,"title":"Clear errors implementation","user":{"login":"offirgolan","id":575938,"avatar_url":"https://avatars.githubusercontent.com/u/575938?v=3","gravatar_id":"","url":"https://api.github.com/users/offirgolan","html_url":"https://github.com/offirgolan","followers_url":"https://api.github.com/users/offirgolan/followers","following_url":"https://api.github.com/users/offirgolan/following{/other_user}","gists_url":"https://api.github.com/users/offirgolan/gists{/gist_id}","starred_url":"https://api.github.com/users/offirgolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offirgolan/subscriptions","organizations_url":"https://api.github.com/users/offirgolan/orgs","repos_url":"https://api.github.com/users/offirgolan/repos","events_url":"https://api.github.com/users/offirgolan/events{/privacy}","received_events_url":"https://api.github.com/users/offirgolan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-20T20:22:30Z","updated_at":"2015-11-24T22:16:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/offirgolan/ember-cp-validations/pulls/82","html_url":"https://github.com/offirgolan/ember-cp-validations/pull/82","diff_url":"https://github.com/offirgolan/ember-cp-validations/pull/82.diff","patch_url":"https://github.com/offirgolan/ember-cp-validations/pull/82.patch"},"body":"Solves #81 \r\n\r\nI do have a couple comments/concerns: \r\n\r\n1. Is clearErrors the correct naming for this?\r\n2. When we clear an error message, should the result object be set to `isValid: true`? Or should we just clear the message?\r\n3. Instead of updating the result object, maybe removing it all together from the result collection would make more sense?\r\n\r\nUsage:\r\n\r\n```js\r\nobj.clearErrors();\r\nobj.clearErrors('presence');\r\nobj.clearErrors(['presence', 'length']);\r\n\r\nobj.get('validations.attrs.foo').clearErrors();\r\n// ...."},"comment":{"url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/comments/159423682","html_url":"https://github.com/offirgolan/ember-cp-validations/pull/82#issuecomment-159423682","issue_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/82","id":159423682,"user":{"login":"rox163","id":313318,"avatar_url":"https://avatars.githubusercontent.com/u/313318?v=3","gravatar_id":"","url":"https://api.github.com/users/rox163","html_url":"https://github.com/rox163","followers_url":"https://api.github.com/users/rox163/followers","following_url":"https://api.github.com/users/rox163/following{/other_user}","gists_url":"https://api.github.com/users/rox163/gists{/gist_id}","starred_url":"https://api.github.com/users/rox163/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rox163/subscriptions","organizations_url":"https://api.github.com/users/rox163/orgs","repos_url":"https://api.github.com/users/rox163/repos","events_url":"https://api.github.com/users/rox163/events{/privacy}","received_events_url":"https://api.github.com/users/rox163/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T22:16:20Z","updated_at":"2015-11-24T22:16:20Z","body":"So far this is what I added to my form component to try to clear error messages and content from all fields when Clear button is clicked - \r\n```\r\nclearForm() {\r\nthis.get('fieldIds').forEach( (fieldId) => {\r\n\t\tthis.set('form_' + fieldId, '');\r\n\t\tthis.set('didValidate', false);\r\n\t\tthis.set('validations.attrs.' + fieldId + '.isInvalid', false);\t\t\t\r\n                this.set('validations.attrs.' + fieldId + '.message', null);\r\n\t\t$('#form_' + fieldId).val(\"\");\r\n\t});\r\n}\r\n```\r\nSeems to work. I do see intermittent issues where sometimes I need to click on the button twice for it to work. "}}