Angular (legacy) directive for SortableJS.
npm install angular-legacy-sortablejs-maintainedangular-legacy-sortable
-----------------------
Angular 1 module that integrates with Sortable.js
npm install angular-legacy-sortablejs-maintained
yarn add angular-legacy-sortablejs-maintained
Don't install the old angular-legacy-sortablejs package as thats not maintained
``js
angular.module('exampleApp', ['ng-sortable'])
.component('dragAndDropExample', {
template:
,
})
`Specifying a Config
You can pass a Config obj to ng-sortable and it will pass this onto the created sortable object. The available options can be found here`js
angular.module('exampleApp', ['ng-sortable'])
.component('dragAndDropExample', {
template: ,
controller: class ExampleController {
constructor() {
this.sortableConf = {
animation: 350,
chosenClass: 'sortable-chosen',
handle: '.grab-handle',
forceFallback: true,
};
}
},
});
`Drag handle
Example showing how use the handle option`js
angular.module('exampleApp', ['ng-sortable'])
.component('dragAndDropExample', {
template: ,
controller: class ExampleController {
constructor() {
this.sortableConf = {
animation: 350,
chosenClass: 'sortable-chosen',
handle: '.grab-handle',
forceFallback: true,
};
}
},
});
`Tests
There are selenium based tests that can be used to check for regressionsRequirements
- node
- yarnSetting up tests
Navigate to the repo directory in a terminal and run yarn
Running e2e tests
To run the e2e tests run each of these commands in a separate terminal window
`bash
npm run serve:example
``bash
npm run webdriver
``bash
npm run test:e2e
``