Carlos Cifuentes
AngularJS library migration · drag and drop

Migrating ui-sortable / ng-sortable / dragula to modern Angular

ui-sortable wrapped jQuery UI Sortable in a directive bound to ng-model.

What replaces it

OptionWhen to choose it
Angular CDK Drag and DropSortable lists, transfer between lists and free dragging, without jQuery UI.

How to migrate it

  1. Replace the directive with cdkDropList and cdkDrag on the list and its items.
  2. Update the array in the drop event with moveItemInArray or transferArrayItem.
  3. Remove jQuery UI once the last sortable list is migrated.

Watch out. ui-sortable is often the only reason jQuery UI is still in the bundle. Removing it is a visible win in load time.

Other libraries

Planning a migration or a micro-frontend platform?

In a 20-minute call you describe your situation and I tell you how I'd approach it. If it isn't worth doing yet, I'll say so.

Message me on LinkedIn