In the company's background logistics, involving 34 provinces and municipalities divided into two parts, part of the distribution area, the other part of the non-distribution area, want to use the function of drag and drop to achieve, the best two parts of the array can be automatically updated.
Just find the Angular-dragon-drop.js plugin to implement. The array elements are automatically updated by dragging.
For example <script> var arr1=[{name: ' Wang ', id:11,city: ' Beijing '},{name: ' Chang ', id:22, ' Hangzhou '}]; var arr2=[];</script>//arr1 for distribution area arr2 to non-delivery area
Dragging through the plugin will automatically update the data by putting the elements in the arr1 {name: ' Wang ', id:11,city: ' Beijing '} objects into the arr2.
<! DOCTYPE html>
Angular-dragon-drop.js bidirectional data binding drag and drop function