Maybe this problem lies in the execution time of $('.sortable').sortable()
.
Sortable finds elements with classname sortable
immediately after the controller is set up.
At that time the ng-repeat
has not been initiated, so the $('.sortable')
finds no element.
In the js fiddle below, the output in console shows this problem.
http://jsfiddle.net/Q5FWt/439/
A quick dirty fix is put $('.sortable').sortable()
in a setTimeout
.
However, manipulating dom element is never an angular way!
A desirable way to achieve this is to construct a directive, or use a angular-ui plugin like this, https://github.com/angular-ui/ui-sortable