You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+77-73Lines changed: 77 additions & 73 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,22 @@ Angular directive (for version >= 4.x ) that makes the DOM element draggable.
10
10
11
11
## Table of contents
12
12
1.[Getting Started](#getting-started)
13
+
2.[Latest Update](#latest-update)
13
14
3.[Installation](#installation)
14
-
4.[Usage](#usage)
15
+
4.[Draggable](#draggable)
16
+
4.[Resizable](#resizable)
15
17
5.[API](#api)
16
18
6.[Events](#events)
17
19
18
20
# Getting Started
19
-
angular2-draggable is an angular (ver >= 4.x) directive that makes the DOM element draggable. (Note that: It's different from drag-and-drop)
21
+
angular2-draggable has angular (ver >= 4.x) directives that make the DOM element draggable and resizable.
22
+
+`ngDraggable`
23
+
+`ngResizable`
20
24
21
25
# Latest Update
26
+
+ 2018.06.25: 2.0.0-beta.0
27
+
+ New: `ngResizable` directive which you can use to make the element resizable! More resizable options are planning. Refer to [demo](https://xieziyu.github.io/angular2-draggable/#/resizable/default)
28
+
22
29
+ 2018.05.23: 1.4.2
23
30
+ Changes: expose boundsCheck() method.
24
31
@@ -55,50 +62,12 @@ angular2-draggable is an angular (ver >= 4.x) directive that makes the DOM eleme
55
62
+ Provide `[scale]` option: to fix scaling issue [#31](https://github.com/xieziyu/angular2-draggable/issues/31)
56
63
+ Provide `[preventDefaultEvent]` option: whether to prevent default mouse or touch event. (default: true)
57
64
58
-
+ 2017.12.20: 1.1.0-beta.0
59
-
60
-
+ Provide `[zIndex]` and `[zIndexMoving]` to control z-index property.
61
-
+ Provide `[bounds]`, `(edge)` and `[inBounds]` to do boundary check and limit element staying in the bounds.
+ 2017.09.19: Fix an issue when dragging with touch.
66
-
67
-
+ 2017.08.26: Fix an issue: clicking before dragging leading to unexpected offset ([PR #12](https://github.com/xieziyu/angular2-draggable/pull/12) by [bmartinson13](https://github.com/bmartinson13))
+ When `ngResizable` is enabled on some element, `ng-resizable` class is automatically assigned to it. And handle elements will be created with `ng-resizable-handle`. You can customize the handle style.
166
168
167
169
# Events
170
+
+ `ngDraggable` directive:
171
+
1. Support `started` and `stopped` events. The `nativeElement` of the host would be emitted.
172
+
2. Support `edge` events only when `[bounds]` is set. It would emit the result of the boundary check.
173
+
3. `(movingOffset)` event emitter: emit position offset when moving
174
+
4. `(endOffset)` event emitter: emit position offset when stop moving
175
+
176
+
+ Simple example:
177
+
+ html:
178
+
```html
179
+
<divngDraggable
180
+
(started)="onDragBegin($event)"
181
+
(stopped)="onDragEnd($event)"
182
+
(movingOffset)="onMoving($event)"
183
+
(endOffset)="onMoveEnd($event)">
184
+
Dragme!
185
+
</div>
186
+
```
168
187
169
-
1. Support `started` and `stopped` events. The `nativeElement` of the host would be emitted.
170
-
2. Support `edge` events only when `[bounds]` is set. It would emit the result of the boundary check.
171
-
3. `(movingOffset)` event emitter: emit position offset when moving
172
-
4. `(endOffset)` event emitter: emit position offset when stop moving
173
-
174
-
+ Simple example:
175
-
+ html:
176
-
```html
177
-
<divngDraggable
178
-
(started)="onDragBegin($event)"
179
-
(stopped)="onDragEnd($event)"
180
-
(movingOffset)="onMoving($event)"
181
-
(endOffset)="onMoveEnd($event)">
182
-
Dragme!
183
-
</div>
184
-
```
188
+
+ `ngResizable` directive: on-going
185
189
186
190
# Demo
187
191
You can clone this repo to your working copy and then launch the demo page in your local machine:
0 commit comments