angular-sortablejs
Advanced tools
Comparing version 1.1.0 to 1.2.0
{ | ||
"name": "angular-sortablejs", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "SortableJS for Angular 2+", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -112,2 +112,7 @@ # angular-sortablejs | ||
### Updating the options | ||
You can pass a new options object at anytime via the `[sortablejsOptions]` binding and the Angular's change detection will check for the changes from the previous options and will call the low level option setter from [Sortable.js](https://github.com/RubaXa/Sortable) to set the new option values. | ||
> Note: It will only detect changes when a brand new options object is passed, not deep changes. | ||
### Drag & drop between two lists | ||
@@ -114,0 +119,0 @@ |
@@ -40,2 +40,16 @@ "use strict"; | ||
}; | ||
SortablejsDirective.prototype.ngOnChanges = function (changes) { | ||
var _this = this; | ||
var optionsChange = changes['_options']; | ||
if (optionsChange && !optionsChange.isFirstChange()) { | ||
var previousOptions_1 = optionsChange.previousValue; | ||
var currentOptions_1 = optionsChange.currentValue; | ||
Object.keys(currentOptions_1).forEach(function (optionName) { | ||
if (currentOptions_1[optionName] !== previousOptions_1[optionName]) { | ||
// use low-level option setter | ||
_this._sortable.option(optionName, currentOptions_1[optionName]); | ||
} | ||
}); | ||
} | ||
}; | ||
SortablejsDirective.prototype.ngOnDestroy = function () { | ||
@@ -42,0 +56,0 @@ this._sortable.destroy(); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22334
319
189