{"action":"closed","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/12150","labels_url":"https://api.github.com/repos/angular/angular.js/issues/12150/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/12150/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/12150/events","html_url":"https://github.com/angular/angular.js/issues/12150","id":89040626,"number":12150,"title":"Calling element.click() causes \"$apply already in progress\" with ng-touch","user":{"login":"thany","id":152227,"avatar_url":"https://avatars.githubusercontent.com/u/152227?v=3","gravatar_id":"","url":"https://api.github.com/users/thany","html_url":"https://github.com/thany","followers_url":"https://api.github.com/users/thany/followers","following_url":"https://api.github.com/users/thany/following{/other_user}","gists_url":"https://api.github.com/users/thany/gists{/gist_id}","starred_url":"https://api.github.com/users/thany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thany/subscriptions","organizations_url":"https://api.github.com/users/thany/orgs","repos_url":"https://api.github.com/users/thany/repos","events_url":"https://api.github.com/users/thany/events{/privacy}","received_events_url":"https://api.github.com/users/thany/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular.js/labels/component:%20ngTouch","name":"component: ngTouch","color":"fef2c0"},{"url":"https://api.github.com/repos/angular/angular.js/labels/severity:%20inconvenient","name":"severity: inconvenient","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/116","html_url":"https://github.com/angular/angular.js/milestones/ngTouch%20Overhaul","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/116/labels","id":1542691,"number":116,"title":"ngTouch Overhaul","description":"","creator":{"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},"open_issues":21,"closed_issues":47,"state":"open","created_at":"2016-01-25T21:26:26Z","updated_at":"2016-01-27T19:25:40Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-06-17T14:57:38Z","updated_at":"2016-01-27T19:25:39Z","closed_at":"2016-01-27T19:25:39Z","body":"With angular-touch installed and working fine, when calling `element.click()` in the process of an $apply (where `element` is a plain vanilla DOM element, gotten from something like `$event.target`) causes an error `$apply already in progress`.\r\n\r\nPresumably this is because ng-touch registers a click handler on each and every element, which calls $apply again, which is no good for Angular.\r\n\r\nI see two solutions possible:\r\n1. Fix angular-touch so that it doesn't do an $apply (for example, using $timeout is common practise)\r\n2. Fix Angular to allow calling $apply while another $apply is already in progress. This one makes the most sense to me. If an $apply is already happening, calling it again don't need to do anything at all.\r\n\r\nAll this is on Angular 1.4.1, angular-touch 1.4.1, no jQuery, and Firefox 38."}}