Angular 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)
Drag me
Dependencies
Angular Draggabilly needs the Draggabilly library and its dependencies.
- You can either install everything via bower (and if your package management resolves transitive packages you are good to go)
- or you can use the packaged version of Draggabilly and the dist version of Angular Draggabilly.
- or in the case of manual install, just add:
'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'
Options
- locking to axes
Drag me verticallyDrag me horizontally
- containment in other elements
x o
- snapping to grid
Snap me to a grid
- dragging by handle
Events
var { console;};$rootScope;$rootScope;$rootScope;
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
npm install
and then use the various tasks:
grunt
: Execute testsgrunt coverage
: Serve coverage report on port 7000grunt test
: Just testgrunt test:e2e
: Just test end to endgrunt test:unit
: Just test unitgrunt tdd
: Watch source and test files and run testsgrunt tdd:e2e
: Watch and test just end to endgrunt tdd:unit
: Watch and test just unitgrunt build
: Just buildgrunt 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.