angular2-draggable icon indicating copy to clipboard operation
angular2-draggable copied to clipboard

Using drag and resize but struggling to save position and size.

Open scottheappey opened this issue 6 years ago • 1 comments

Geting x=Nan & y=Nan

How do I write this so that if undefined don't use: [position]='{x: xitem.x, y:xitem.y}'

scottheappey avatar Oct 02 '19 13:10 scottheappey

I managed to save the position. But I'm sure there is a better way to write this:

<div *ngIf="xitem.x" ngDraggable (endOffset)="onMoveEnd(xitem, $event)" [position]='{x: xitem.x, y:xitem.y}' ngResizable [rzHandles]="'n,e,s,w,se,sw,ne,nw'" (rzStop)="onResizeStop(xitem, $event)" id="pill" class="pill"> ....

and

<div *ngIf="!xitem.x" ngDraggable (endOffset)="onMoveEnd(xitem, $event)" ngResizable [rzHandles]="'n,e,s,w,se,sw,ne,nw'" (rzStop)="onResizeStop(xitem, $event)" id="pill" class="pill"> ....

Now I need to save the size and position after resizing ...

scottheappey avatar Oct 02 '19 17:10 scottheappey