{"action":"closed","issue":{"url":"https://api.github.com/repos/angular-ui/ui-sortable/issues/384","labels_url":"https://api.github.com/repos/angular-ui/ui-sortable/issues/384/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-sortable/issues/384/comments","events_url":"https://api.github.com/repos/angular-ui/ui-sortable/issues/384/events","html_url":"https://github.com/angular-ui/ui-sortable/issues/384","id":106935291,"number":384,"title":"Drag & drop changes existing scopes ","user":{"login":"renehamburger","id":4340524,"avatar_url":"https://avatars.githubusercontent.com/u/4340524?v=3","gravatar_id":"","url":"https://api.github.com/users/renehamburger","html_url":"https://github.com/renehamburger","followers_url":"https://api.github.com/users/renehamburger/followers","following_url":"https://api.github.com/users/renehamburger/following{/other_user}","gists_url":"https://api.github.com/users/renehamburger/gists{/gist_id}","starred_url":"https://api.github.com/users/renehamburger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renehamburger/subscriptions","organizations_url":"https://api.github.com/users/renehamburger/orgs","repos_url":"https://api.github.com/users/renehamburger/repos","events_url":"https://api.github.com/users/renehamburger/events{/privacy}","received_events_url":"https://api.github.com/users/renehamburger/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-17T08:31:17Z","updated_at":"2015-09-17T10:46:12Z","closed_at":"2015-09-17T10:46:12Z","body":"You're probably aware of this but it's not intuitive and should probably be mentioned in your docs:\r\n\r\nWhen an element is dropped at the beginning or in the middle of an existing list, it is not created with a new scope but rather takes over the scope of the element already in that list. All following elements will be moved down and take over the scope of their successor and a new scope will be created for the last element in the list.\r\n\r\nThis is  problematic for any async callbacks which rely on the scope in the closure remaining the same, e.g. `scope.$watch('a', function() {console.log(scope.b); }`.\r\n\r\nYou can see this behaviour here: http://codepen.io/leanix/pen/MayjRP.\r\n\r\nIn the case of rearranging items within a list, everything is as expected: DOM elements are moved together with their scopes."}}