Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
template: planbook.hbs
{{render 'dates'}}
template: dates.hbs
controller: see DatesController below
itemControllers: see DateController below)
{{#each arrangedContent}}
{{render 'planbook/date' controller.planbookDate}}
template: planbook/date.hbs
model: see PlanbookDate below
{{render 'routine' routine}}
var DatesController = Ember.ArrayController.extend({
init: function(){
_loadDates: function(){
var range = this._getRange(); // returns array of dates ["2014-02-02", "2014-02-03"]
var content =, this)
_createDateController: function(date){
return this.container.lookupFactory('controller:date').create({date: date})
export default DatesController
var DateController = Ember.Controller.extend({
needs: ['dates', 'planbook'],
planbookDate: function(){
var id = this.get('') + ":" + this.get('date')
}.property('', 'controllers.planbook')
export default DateController
var PlanbookDate = Ember.Model.extend({
routine: Ember.belongsTo('routine', {key: 'routineId'}),
export default PlanbookDate;
var Routine = Ember.Model.extend({
parts: Ember.hasMany('part', {embedded: true, key: 'parts'}),
export default Routine;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.