February 2016
Beginner to intermediate
308 pages
5h 46m
English
Drag and drop is a part of the HTML5 standard. It allows the user to grab objects in the DOM and drop them at different locations. Any element can be draggable if the browser supports it. Most modern browsers do.
In this recipe, we'll see an example of dragging an IMG file to a drop zone on the screen.
$ ember g component drag-drop-zone $ ember g component drag-drop
The drag-drop-zone component will represent the area where each item will be dropped. The drag-drop component will be the item to be dropped.
drag-drop-zone.js file:// app/components/drag-drop-zone.js import Ember from 'ember'; export default Ember.Component.extend({ classNames: ['draggable-dropzone'], ...Read now
Unlock full access