Created
October 11, 2016 09:14
-
-
Save jelhan/87899b16e2a9c859667d92cc3a7b34b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import groupBy from 'ember-group-by'; | |
const { computed } = Ember; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
meetings: computed.readOnly('model'), | |
meetingsPerDay: groupBy('meetings', 'day') | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import moment from 'moment'; | |
const { computed, get } = Ember; | |
const Meeting = Ember.Object.extend({ | |
date: null, | |
day: computed('date', function() { | |
let date = get(this, 'date'); | |
return moment(date).format('LL'); | |
}), | |
topic: null | |
}); | |
export default Ember.Route.extend({ | |
model() { | |
return [ | |
Meeting.create({ | |
date: moment('2016-10-11 12:00'), | |
topic: 'foo' | |
}), | |
Meeting.create({ | |
date: moment('2016-10-11 15:00'), | |
topic: 'bar' | |
}), | |
Meeting.create({ | |
date: moment('2016-10-12 08:00'), | |
topic: 'baz' | |
}) | |
]; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.10.5", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.6.0", | |
"ember-data": "2.6.0", | |
"ember-template-compiler": "2.6.0", | |
"ember-testing": "2.6.0" | |
}, | |
"addons": { | |
"ember-moment": "4.1.0", | |
"ember-group-by": "0.0.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment