Skip to content

Instantly share code, notes, and snippets.

@megganeturner
Created August 2, 2018 06:46
Show Gist options
  • Save megganeturner/0151204b584b7e628f79bc4ca17a0841 to your computer and use it in GitHub Desktop.
Save megganeturner/0151204b584b7e628f79bc4ca17a0841 to your computer and use it in GitHub Desktop.
DragonDrop
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
import { computed } from '@ember/object';
export default Ember.Controller.extend({
items: computed(function p () {
return [{
img: 'http://www.fillmurray.com/100/100',
title: 'Phil Murray',
order: 1,
}, {
img: 'http://www.placecage.com/100/100',
title: 'Nicholas Cage',
order: 2,
}, {
img: 'http://www.stevensegallery.com/100/100',
title: 'Steven Segal',
order: 3,
}]
}),
});
{{log items}}
{{drag-drop items=items}}
{{#each items as |item|}}
<div draggable=true>
<img src={{item.img}}>
{{item.title}}
</div>
{{/each}}
{
"version": "0.15.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.2.2",
"ember-template-compiler": "3.2.2",
"ember-testing": "3.2.2"
},
"addons": {
"ember-data": "3.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment