marceljuenemann / angular-drag-and-drop-lists

Angular directives for sorting nested lists using the HTML5 Drag & Drop API
MIT License
2.16k stars 713 forks source link

How can i implement dnd list with ng-repeat iterating over object properties? #425

Open nadvez opened 7 years ago

nadvez commented 7 years ago

I am trying to implement dnd-list with a JSON where i have unknown key and values. I am using something like below but that doesn't work.

> <ul><li ng-repeat="(name, value) in values"
>       dnd-draggable="value"
>             dnd-effect-allowed="move"
>             dnd-moved="values.splice($index, 1)"
>             >
> <div ng-show="name.indexOf('[Leaf]') != -1" class="form-container box box-blue" >
>       <h3>Leaf {{name|split:'::':1}}</h3>
>       <ul>
>           <li ng-repeat="(leaftype,leafvalue) in value">
>               <p class="item">{{leaftype}} {{leafvalue}}</p>
>           </li>   
>       </ul>
>       </div>
> </li>
> </ul>

Can you recommend how do i implement this ?