Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Ember from 'ember';
- export default Ember.Controller.extend({
- appName: 'Ember Twiddle',
- datums: [
- { id: 1, name: 'banana' },
- { id: 2, name: 'pineapple' }
- ],
- actions: {
- moveTop(datum) {
- const datums = this.get('datums')
- datums.removeObject(datum)
- datums.unshiftObject(datum)
- },
- moveBottom(datum) {
- const datums = this.get('datums')
- datums.removeObject(datum)
- datums.pushObject(datum)
- },
- }
- });
Add Comment
Please, Sign In to add comment