{"action":"created","issue":{"url":"https://api.github.com/repos/marceljuenemann/angular-drag-and-drop-lists/issues/230","repository_url":"https://api.github.com/repos/marceljuenemann/angular-drag-and-drop-lists","labels_url":"https://api.github.com/repos/marceljuenemann/angular-drag-and-drop-lists/issues/230/labels{/name}","comments_url":"https://api.github.com/repos/marceljuenemann/angular-drag-and-drop-lists/issues/230/comments","events_url":"https://api.github.com/repos/marceljuenemann/angular-drag-and-drop-lists/issues/230/events","html_url":"https://github.com/marceljuenemann/angular-drag-and-drop-lists/issues/230","id":143925062,"number":230,"title":"Recursive template","user":{"login":"Daaru00","id":8782994,"avatar_url":"https://avatars.githubusercontent.com/u/8782994?v=3","gravatar_id":"","url":"https://api.github.com/users/Daaru00","html_url":"https://github.com/Daaru00","followers_url":"https://api.github.com/users/Daaru00/followers","following_url":"https://api.github.com/users/Daaru00/following{/other_user}","gists_url":"https://api.github.com/users/Daaru00/gists{/gist_id}","starred_url":"https://api.github.com/users/Daaru00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daaru00/subscriptions","organizations_url":"https://api.github.com/users/Daaru00/orgs","repos_url":"https://api.github.com/users/Daaru00/repos","events_url":"https://api.github.com/users/Daaru00/events{/privacy}","received_events_url":"https://api.github.com/users/Daaru00/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-28T08:19:08Z","updated_at":"2016-03-28T08:50:58Z","closed_at":null,"body":"I've tried to build a \"category tree\" using a recursive template\r\n\r\n```javascript\r\n$scope.categories = [\r\n    {\"name\":\"Cat1\",\"children\":[\r\n      {\"name\":\"Cat2\",\"children\":[]}\r\n    ]},\r\n    {\"name\":\"Cat3\",\"children\":[]}\r\n];\r\n```\r\n```html\r\n<script type=\"text/ng-template\" id=\"category.html\">\r\n    {{category.name}}\r\n    <ul dnd-list=\"category.children\">\r\n        <li ng-repeat=\"category in category.children\"\r\n            dnd-draggable=\"category\"\r\n            dnd-effect-allowed=\"move\"\r\n            dnd-moved=\"category.children.splice($index, 1)\"\r\n            ng-include=\"'category.html'\">\r\n        </li>\r\n    </ul>\r\n </script>\r\n         \r\n<ul dnd-list=\"categories\">\r\n  <li ng-repeat=\"category in categories\"\r\n     dnd-draggable=\"category\"\r\n     dnd-moved=\"categories.splice($index, 1)\"\r\n     dnd-effect-allowed=\"move\"\r\n     ng-include=\"'category.html'\">\r\n  </li>\r\n</ul>\r\n```\r\nbut the children is not moved but is copied (inside the template) when I drag everywhere, the parent category instead is correctly moved (outside the template) when I drag into a children list.\r\n\r\nI'm doing something wrong?\r\n"},"comment":{"url":"https://api.github.com/repos/marceljuenemann/angular-drag-and-drop-lists/issues/comments/202308024","html_url":"https://github.com/marceljuenemann/angular-drag-and-drop-lists/issues/230#issuecomment-202308024","issue_url":"https://api.github.com/repos/marceljuenemann/angular-drag-and-drop-lists/issues/230","id":202308024,"user":{"login":"Daaru00","id":8782994,"avatar_url":"https://avatars.githubusercontent.com/u/8782994?v=3","gravatar_id":"","url":"https://api.github.com/users/Daaru00","html_url":"https://github.com/Daaru00","followers_url":"https://api.github.com/users/Daaru00/followers","following_url":"https://api.github.com/users/Daaru00/following{/other_user}","gists_url":"https://api.github.com/users/Daaru00/gists{/gist_id}","starred_url":"https://api.github.com/users/Daaru00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daaru00/subscriptions","organizations_url":"https://api.github.com/users/Daaru00/orgs","repos_url":"https://api.github.com/users/Daaru00/repos","events_url":"https://api.github.com/users/Daaru00/events{/privacy}","received_events_url":"https://api.github.com/users/Daaru00/received_events","type":"User","site_admin":false},"created_at":"2016-03-28T08:50:58Z","updated_at":"2016-03-28T08:50:58Z","body":"You are right, I try your solution but I still have the same issue, I solved using $parent.$parent.category.children.\r\n\r\n```html\r\n<script type=\"text/ng-template\" id=\"category.html\">\r\n    {{category.name}}\r\n    <ul dnd-list=\"category.children\">\r\n        <li ng-repeat=\"category in category.children\"\r\n            dnd-draggable=\"category\"\r\n            dnd-effect-allowed=\"move\"\r\n            dnd-moved=\"$parent.$parent.category.children.splice($index, 1)\"\r\n            ng-include=\"'category.html'\">\r\n        </li>\r\n    </ul>\r\n</script>\r\n\r\n<ul dnd-list=\"categories\">\r\n    <li ng-repeat=\"category in categories\"\r\n        dnd-draggable=\"category\"\r\n        dnd-moved=\"categories.splice($index, 1)\"\r\n        dnd-effect-allowed=\"move\"\r\n        ng-include=\"'category.html'\"\r\n        >\r\n    </li>\r\n</ul>\r\n```\r\nSorry, It was not a problem of angular-drag-and-drop-lists, thx for the prompt response.\r\n"}}