Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-sortablejs

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-sortablejs - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

2

package.json
{
"name": "angular-sortablejs",
"version": "1.0.1",
"version": "1.1.0",
"description": "SortableJS for Angular 2+",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -153,3 +153,9 @@ # angular-sortablejs

```
### Bind events inside Angular zone
By default, the boolean parameter **runInsideAngular** is set to **false**.
This means that the initial binding of all mouse events of the component will be set so that they **will not** trigger Angular's change detection.
If this parameter is set to true, then for large components - with a lot of data bindings - the UI will function in a staggered and lagging way (mainly when dragging items), while every event will trigger the change detection (which might be needed in some special edge cases).
### Configure the options globally

@@ -156,0 +162,0 @@

@@ -23,8 +23,18 @@ "use strict";

var SortablejsDirective = (function () {
function SortablejsDirective(element) {
function SortablejsDirective(element, zone) {
this.element = element;
this.zone = zone;
this.runInsideAngular = false;
}
SortablejsDirective.prototype.ngOnInit = function () {
var _this = this;
// onChange???
this._sortable = new Sortable(this.element.nativeElement, this.options);
if (this.runInsideAngular) {
this._sortable = new Sortable(this.element.nativeElement, this.options);
}
else {
this.zone.runOutsideAngular(function () {
_this._sortable = new Sortable(_this.element.nativeElement, _this.options);
});
}
};

@@ -101,2 +111,6 @@ SortablejsDirective.prototype.ngOnDestroy = function () {

], SortablejsDirective.prototype, "_options", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], SortablejsDirective.prototype, "runInsideAngular", void 0);
SortablejsDirective = __decorate([

@@ -106,3 +120,3 @@ core_1.Directive({

}),
__metadata('design:paramtypes', [core_1.ElementRef])
__metadata('design:paramtypes', [core_1.ElementRef, core_1.NgZone])
], SortablejsDirective);

@@ -109,0 +123,0 @@ return SortablejsDirective;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc