陷入我有列表列表的问题,我想通过拖放我的模型来重新排序列表列表
{
"selected": null,
"lists": {
"A": [
{
"data": "code"
},
{
"data": "code enable"
},
{
"data": "code disable"
}
],
"B": [
{
"data": "code"
},
{
"data": "code enable"
},
{
"data": "code disable"
}
],
"C": [
{
"data": "code"
},
{
"data": "code decode"
},
{
"data": "code decode"
}
]
}
}
现在我想重新订购这个模型,如果我将列表C 拖到列表A 它应该替换div新模型将< / p>
{
"selected": null,
"lists": {
"C": [
{
"data": "code"
},
{
"data": "code decode"
},
{
"data": "code decode"
}
],
"B": [
{
"data": "code"
},
{
"data": "code enable"
},
{
"data": "code disable"
}
],
"A": [
{
"data": "code"
},
{
"data": "code enable"
},
{
"data": "code disable"
}
],
}
}
app.html
<div ng-repeat="list in models.lists" class="col-md-6">
<div class="panel panel-info" ng-repeat="data in lists">
<div class="panel-heading">
<h3 class="panel-title">List {{data.data}}</h3>
</div>
</div>
</div>
app.js
$scope.models = {
selected: null,
lists: {"A": [], "B": [],"C":[]
};
// Generate initial model