{"action":"created","issue":{"url":"https://api.github.com/repos/jrief/django-angular/issues/135","labels_url":"https://api.github.com/repos/jrief/django-angular/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/jrief/django-angular/issues/135/comments","events_url":"https://api.github.com/repos/jrief/django-angular/issues/135/events","html_url":"https://github.com/jrief/django-angular/pull/135","id":50690159,"number":135,"title":"Issue with grouped checkboxes in firefox","user":{"login":"jamesbrobb","id":1752245,"avatar_url":"https://avatars.githubusercontent.com/u/1752245?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesbrobb","html_url":"https://github.com/jamesbrobb","followers_url":"https://api.github.com/users/jamesbrobb/followers","following_url":"https://api.github.com/users/jamesbrobb/following{/other_user}","gists_url":"https://api.github.com/users/jamesbrobb/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesbrobb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesbrobb/subscriptions","organizations_url":"https://api.github.com/users/jamesbrobb/orgs","repos_url":"https://api.github.com/users/jamesbrobb/repos","events_url":"https://api.github.com/users/jamesbrobb/events{/privacy}","received_events_url":"https://api.github.com/users/jamesbrobb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2014-12-02T17:50:35Z","updated_at":"2015-03-21T16:23:22Z","closed_at":"2015-02-21T20:14:24Z","pull_request":{"url":"https://api.github.com/repos/jrief/django-angular/pulls/135","html_url":"https://github.com/jrief/django-angular/pull/135","diff_url":"https://github.com/jrief/django-angular/pull/135.diff","patch_url":"https://github.com/jrief/django-angular/pull/135.patch"},"body":"Can someone comfirm this please. I'm using:\r\n\r\nOSX 10.7.5\r\nFirefox 33.1.1\r\n\r\n1) Go to either\r\n\r\nhttp://djangular.aws.awesto.com/form_validation/\r\n\r\nor\r\n\r\nhttp://djangular.aws.awesto.com/combined_validation/\r\n\r\n2) Scroll to 'notify me' and select 'postcard' -- i get the 'required' error message\r\n\r\n3) deselect 'postcard' -- i get the valid tick\r\n\r\n4) select more than one checkbox in the group and the valid tick appears\r\n\r\n5) deselect all and the tick stays until you reselect one\r\n\r\nAlso, once you've force submitted the form to ajax (in any browser) with no checkboxes selected, the valid tick does not appear once any checkboxes are selected."},"comment":{"url":"https://api.github.com/repos/jrief/django-angular/issues/comments/84385067","html_url":"https://github.com/jrief/django-angular/pull/135#issuecomment-84385067","issue_url":"https://api.github.com/repos/jrief/django-angular/issues/135","id":84385067,"user":{"login":"jamesbrobb","id":1752245,"avatar_url":"https://avatars.githubusercontent.com/u/1752245?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesbrobb","html_url":"https://github.com/jamesbrobb","followers_url":"https://api.github.com/users/jamesbrobb/followers","following_url":"https://api.github.com/users/jamesbrobb/following{/other_user}","gists_url":"https://api.github.com/users/jamesbrobb/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesbrobb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesbrobb/subscriptions","organizations_url":"https://api.github.com/users/jamesbrobb/orgs","repos_url":"https://api.github.com/users/jamesbrobb/repos","events_url":"https://api.github.com/users/jamesbrobb/events{/privacy}","received_events_url":"https://api.github.com/users/jamesbrobb/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T16:23:22Z","updated_at":"2015-03-21T16:23:22Z","body":"If you look at my commits you'll see that the first quick fix i came up with for this issue, was to simply wrap the `change` event handlers call to `validate` in a $timeout. Which then safely calls `scope.$apply`. Which is essentially what you're doing. So i understand why the issue is occurring.\r\n\r\nThe problem i have with the quick fix of `scope.$apply`, is that *it* feels like a hack. Its just a brute force solution that fails to understand why this issue only occurs in FF and not in chrome, safari or IE.\r\n\r\nThat aside, i can understand why you might consider my solution using `ng-change` to be a 'hack', as you believe it accidentally fixes the issue. But i can assure you it was a very much intentional and considered approach. \r\n\r\nWithin angular an inputs current state is represented by its `ngModel`. But your logic mixes and matches angular model/controller state and DOM state (checkbox.checked) to determine the current state of the form. Which is not the correct way to handle this scenario. You should be monitoring the checkbox's `ngModel` for change (thus the use of the `ng-change` directive) and then use those values to determine the current state of the form. The `ngModel` should be the single source of state.\r\n\r\nRegardless of how `ng-change` is added to the input (i'm currently looking at an alternative solution that uses `ngModel.$viewlisteners` instead - **but am also wondering if this attribute couldn't just be added in the python widget?**), i strongly believe that what i've outlined and initially implemented, is the correct way to deal with this scenario."}}