{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui-tree/angular-ui-tree/issues/262","labels_url":"https://api.github.com/repos/angular-ui-tree/angular-ui-tree/issues/262/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui-tree/angular-ui-tree/issues/262/comments","events_url":"https://api.github.com/repos/angular-ui-tree/angular-ui-tree/issues/262/events","html_url":"https://github.com/angular-ui-tree/angular-ui-tree/issues/262","id":46178360,"number":262,"title":"beforeDrop with 'confirm' call in it causes '$apply already in progress'","user":{"login":"bronielsen","id":7545256,"avatar_url":"https://avatars.githubusercontent.com/u/7545256?v=3","gravatar_id":"","url":"https://api.github.com/users/bronielsen","html_url":"https://github.com/bronielsen","followers_url":"https://api.github.com/users/bronielsen/followers","following_url":"https://api.github.com/users/bronielsen/following{/other_user}","gists_url":"https://api.github.com/users/bronielsen/gists{/gist_id}","starred_url":"https://api.github.com/users/bronielsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bronielsen/subscriptions","organizations_url":"https://api.github.com/users/bronielsen/orgs","repos_url":"https://api.github.com/users/bronielsen/repos","events_url":"https://api.github.com/users/bronielsen/events{/privacy}","received_events_url":"https://api.github.com/users/bronielsen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-10-18T15:13:29Z","updated_at":"2015-08-14T09:25:21Z","closed_at":null,"body":"Hi,\r\n\r\nLove this plugin. Saved me a lot of time!\r\n\r\nI am having a problem similar to the one discussed here: https://github.com/JimLiu/angular-ui-tree/issues/213\r\n\r\nI am using Chrome. \r\n\r\nI created a beforeDrop callback in order to be able to allow the user to cancel the drop. \r\n\r\nFor testing I currently have the following in the beforeDrop (in typescript):\r\n<pre>\r\nvar confirmation: boolean;\r\nconfirmation = confirm(this.stringAreYouSure);\r\nevent.source.nodeScope.$$apply = false; // Note: I set this false for this test\r\n</pre>\r\n\r\nSince the $$apply is set to false, the drop never goes through.\r\n\r\nWith this I get an '$apply already in progress' error. If I remove the 'confirm' call like this:\r\n<pre>\r\nvar confirmation: boolean;\r\n// confirmation = confirm(this.stringAreYouSure);\r\nevent.source.nodeScope.$$apply = false; // Note: I set this false for this test\r\n</pre>\r\nI do not get the problem.\r\n\r\nSo the problem seems to be an interaction between the confirm call and the Angular UI Tree library.\r\n\r\nAny ideas?"},"comment":{"url":"https://api.github.com/repos/angular-ui-tree/angular-ui-tree/issues/comments/131042022","html_url":"https://github.com/angular-ui-tree/angular-ui-tree/issues/262#issuecomment-131042022","issue_url":"https://api.github.com/repos/angular-ui-tree/angular-ui-tree/issues/262","id":131042022,"user":{"login":"bronielsen","id":7545256,"avatar_url":"https://avatars.githubusercontent.com/u/7545256?v=3","gravatar_id":"","url":"https://api.github.com/users/bronielsen","html_url":"https://github.com/bronielsen","followers_url":"https://api.github.com/users/bronielsen/followers","following_url":"https://api.github.com/users/bronielsen/following{/other_user}","gists_url":"https://api.github.com/users/bronielsen/gists{/gist_id}","starred_url":"https://api.github.com/users/bronielsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bronielsen/subscriptions","organizations_url":"https://api.github.com/users/bronielsen/orgs","repos_url":"https://api.github.com/users/bronielsen/repos","events_url":"https://api.github.com/users/bronielsen/events{/privacy}","received_events_url":"https://api.github.com/users/bronielsen/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T09:25:21Z","updated_at":"2015-08-14T09:25:21Z","body":"Hi, did not notice this question before now. Did you find a solution for this?"}}