Angular Sortablejs directive
This package provides Angular binding for Storablejs which works with standard arrays as well as Angular FormArray
objects.
Demo
Basic usage
View on GitHubThis examples shows various elements that can be sortable. They share the same model, so reordering elements in one container propagates to all other containers in the example.
Button groups
Cards
Navigation
The actual model
Sortable FormArray
View on GitHubMost of the time one wants to sort something more than just data. Complex form inputs with FormArray controls are also supported.
FormArray value
Events
View on GitHubBinding to the events is easy. Any even could be attached as a property of Sortablejs. The example below binds to the onUpdate event. Drag the items and track the amount of updates.
- Element 1
- Element 2
- Element 3
- Element 4
- Element 5
Scrolling options
View on GitHubMost browsers automatically scroll content as you drag items to the edge of the screen. If the default behaviour doesn't work for you, Sortablejs provides an option to cofigure scrolling.
- Element 1
- Element 2
- Element 3
- Element 4
- Element 5
- Element 6
- Element 7
- Element 8
- Element 9
- Element 10
- Element 11
- Element 12
- Element 13
- Element 14
- Element 15
- Element 16
- Element 17
- Element 18
- Element 19
- Element 20
- Element 21
- Element 22
- Element 23
- Element 24
- Element 25
- Element 26
- Element 27
- Element 28
- Element 29
- Element 30
Transfer between lists
View on GitHubThese lists are connected together. You can drag / drop elements across the lists.
- Element 1
- Element 2
- Element 3
- Element 4
- Element 5
- Element 6
- Element 7
- Element 8
- Element 9
- Element 10
List states
- Element 1
- Element 2
- Element 3
- Element 4
- Element 5
- Element 6
- Element 7
- Element 8
- Element 9
- Element 10
List states
- Element 1
- Element 2
- Element 3
- Element 4
- Element 5
- Element 6
- Element 7
- Element 8
- Element 9
- Element 10
- Element 11
- Element 12
- Element 13
List states
Union example
View on GitHubThe list items can be of different types (the element type can be a union type).
The actual model
Table items
View on GitHubTable rows are nested inside tbody, and require the container selector to be set accordingly.
City | Description |
---|---|
Ankara | Ankara description |
Moscow | Moscow description |
Munich | Munich description |
Paris | Paris description |
Washington | Washington description |