在AngularJS中拖放可排序的ng:repeats? [英] Drag and drop sortable ng:repeats in AngularJS?
本文介绍了在AngularJS中拖放可排序的ng:repeats?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在AngularJS中的 ng-repeat
元素上使用 jQuery.sortable
容易吗?
Is it at all easy to use jQuery.sortable
on ng-repeat
elements in AngularJS?
如果重新排序自动重新传播到源数组中的项,那将是很棒的.恐怕这两个系统会打架.有更好的方法吗?
It would be awesome if re-ordering the items automatically propagated that ordering back into the source array. I'm afraid the two systems would fight though. Is there a better way to do this?
推荐答案
Angular UI具有可排序的指令,单击此处进行演示
Angular UI has a sortable directive,Click Here for Demo
位于 ui-sortable 上的代码,用法:
<ul ui-sortable ng-model="items">
<li ng-repeat="item in items">{{ item }}</li>
</ul>
这篇关于在AngularJS中拖放可排序的ng:repeats?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文