2015-10-09 76 views
0

我正在關注此鏈接 http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/advanced 用於構建嵌套拖放。我有父項目和子項目,父項目工作正常,我在dnd-list =「ItemsParent」中添加了一個列表,並且在父項目中添加了刪除的項目。 我有第二個子項目列表dnd-list =「ItemsChild」當我丟棄子項目時,項目正在父項目列表中添加。普萊斯建議我如何解決這個問題。角度拖放列表嵌套

Below is small part of my code: 
<div `dnd-list`=`ItemsParent`> 
    <div data-ng-repeat="item in ItemsParent"> 
    <div dnd-list="ItemsChild"> 
     <div data-ng-repeat="chItems in ItemsChild"> 
      {{chItems.Name }} 
     </div> 
    </div> 

    </div> 
</div> 

回答

0

我想,可能你沒有維護父母和子女的關係。您的代碼應該是這樣的

下面是我的代碼小部分:

<div data-ng-repeat="item in ItemsParent"> 
     <div data-ng-repeat="chItems in item.ItemsChild"> 
      {{chItems.Name }} 
     </div> 
</div> 

希望這將幫助你。

+0

謝謝,但對於這個問題,我已禁用父母,如果我想移動的項目的孩子。 –