import { NgxMoveableComponent } from "ngx-moveable"; import { ViewChild, ElementRef, Component } from "@angular/core"; @Component({ selector: "ngx-app", templateUrl: "./App.component.html" }) export default class NgxAppComponent { maxWidth: any = "$preview_maxWidth"; maxHeight: any = "$preview_maxHeight"; minWidth: any = "$preview_minWidth"; minHeight: any = "$preview_minHeight"; draggable: any = "$preview_draggable"; throttleDrag: any = "$preview_throttleDrag"; edgeDraggable: any = "$preview_edgeDraggable"; startDragRotate: any = "$preview_startDragRotate"; throttleDragRotate: any = "$preview_throttleDragRotate"; resizable: any = "$preview_resizable"; keepRatio: any = "$preview_keepRatio"; throttleResize: any = "$preview_throttleResize"; renderDirections: any = "$preview_renderDirections"; rotatable: any = "$preview_rotatable"; throttleRotate: any = "$preview_throttleRotate"; rotationPosition: any = "$preview_rotationPosition"; @ViewChild("targetRef") targetRef!: ElementRef; @ViewChild("moveableRef") moveableRef!: NgxMoveableComponent; onDrag(e) { e.target.style.transform = e.transform; } onResize(e) { e.target.style.width = `${e.width}px`; e.target.style.height = `${e.height}px`; e.target.style.transform = e.drag.transform; } onRotate(e) { e.target.style.transform = e.drag.transform; } }