ngx-draggable-resizer
A light-weight jquery-ui based directive in Angular for resizing and dragging elements.
DEMO: https://senalkumarage.github.io/ngx-draggable-resizer-demo/
Features
- Element resize
- Element drag
- OnPositionChange event listener
- OnSizeChange event listener
Dependencies
- Angular 7.x
- jquery 3.x
- jquery-ui 1.x
Install
npm install ngx-draggable-resizer --save
Setup
- Step 1: Importing the module
; ;
- Step 2: Adding styles
- If you are using sass you can import the css
// regular style toast;- Or if you are using angular-cli you can add this to your angular.json
"styles": - Step 3: Including jQuery
- This step is not relevant if you have already setup jQuery in your project
- In your
angular.json
file
"scripts":
Usage
Options
Option | Type | Default | Description |
---|---|---|---|
draggableOnly | boolean | false | Whether the element can only be dragged |
resizableOnly | boolean | false | Whether the element can only be resized |
Events
Name | Description | Returns |
---|---|---|
sizeChanged | Triggers when the element gets resized | {width: number, height: number} |
positionChange | Triggers when the element gets moved | {top: string, left: string} |
License
MIT