An angular wrapper for Draggabilly
npm install angular-draggabillyAngular Draggabilly directive - drag and drop for Angular
======================



This is an angular wrapper to Draggabilly.
Does not create its own scope and does not pollute the parent scope.
And for all the ones that are curious about whether this one needs jquery-ui:
> look ma, no jQuery!
Usage
-----
* The simplest form (just a draggable element)
``html`Drag me
javascript
'bower_components/classie/classie.js',
'bower_components/eventEmitter/EventEmitter.js',
'bower_components/eventie/eventie.js',
'bower_components/get-style-property/get-style-property.js',
'bower_components/get-size/get-size.js',
'bower_components/draggabilly/draggabilly.js',
'bower_components/angular-draggabilly/dist/angular-draggabilly.js'
`$3
* locking to axes
`html
Drag me vertically
Drag me horizontally
`
* containment in other elements
`html
x
o
`
* snapping to grid
`html
Snap me to a grid
`
* dragging by handle
`html
`$3
`javascript
var handler = function($event, instance, originalEvent, pointer) {
console.log('The element', instance.element, 'is now at', instance.position.x, instance.position.y);
};
$rootScope.$on('draggie.start', handler);
$rootScope.$on('draggie.move', handler);
$rootScope.$on('draggie.end', handler);
`
By default, all events are emitted, however eventing can be disabled (and should be if not used, because it saves quite a few digest cycles) by adding draggie-events="" or selectively enabled by using start, move and end, e.g. draggie-events="start,end".Demo
----
You can start a demo server with
grunt demo and go to localhost:8000/demo to test the directive.Grunt Tasks
-----------
Initialize with
`console
npm install
`
and then use the various tasks: *
grunt: Execute tests
* grunt coverage: Serve coverage report on port 7000
* grunt test: Just test
* grunt test:e2e: Just test end to end
* grunt test:unit: Just test unit
* grunt tdd: Watch source and test files and run tests
* grunt tdd:e2e: Watch and test just end to end
* grunt tdd:unit: Watch and test just unit
* grunt build: Just build
* grunt release: Test, build, bump patch version, commit, add version tag and push
test tasks have a --browsers option to specify the browsers you want to use Browsers can also be set by the following environment-variables
`
PROTRACTOR_BROWSERS=Firefox,Chrome
KARMA_BROWSERS=Firefox,PhantomJS
``_See Gruntfile.js and tasks/options for all task details._
LICENSE
-------
> The MIT License
>
> Copyright (c) 2014 Jimdo GmbH http://jimdo.com
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.