comamitc
comamitc

Reputation: 841

AngularJS and jQuery-UI Sortable not working

I am trying to build a very simple angularjs directive that will allow me to nest jquery-ui sortable lists.

I have a pure jquery version that works but when I add in the angularjs directive code it seems to not enable any child elements with the connectWith arguement. Additionally, using the angular version, if I add a dummy <li> element in my sub-list jquery seems to recognize it as a list. I'm not sure what's causing the behavior.

Can you spot what I'm doing wrong?

Does not work without <li> element in sub-list

http://jsfiddle.net/comamitc/4hAy3/2/

Works with dummy <li> element but that element can be moved around and causes confusion.

http://jsfiddle.net/comamitc/4hAy3/3/

Upvotes: 1

Views: 2454

Answers (1)

zszep
zszep

Reputation: 4458

Angular-ui has a ui:sortable directive. You don't need jquery for this to work. Look at this fiddle

 <ul ui:sortable ng:model="list">

Upvotes: 1

Related Questions