Last active
December 22, 2015 07:38
-
-
Save darklow/6438877 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// in older versions, for getting model from different controller i was using: | |
App.FoodController = Em.ArrayController.extend({ | |
addFood: function (food) { | |
var items = this.controllerFor('table').get('model').get('tab.tabItems'); | |
tabItems.createRecord({ | |
food: food | |
}) | |
} | |
}); | |
// in RC2 | |
App.TableRoute = Ember.Route.extend({ | |
setupController: function(model) { | |
this.controllerFor('tables').set('selectedTable', model); | |
} | |
}); | |
App.FoodController = Ember.ArrayController.extend({ | |
needs: ['tables'], | |
tableBinding: 'controllers.tables.selectedTable', | |
addFood: function(food) { | |
var tabItems = this.get('table.tab.tabItems'); | |
tabItems.createRecord({ | |
food: food | |
}); | |
} | |
}); | |
// Anyone can help to understand how to fix this so that it works in latest | |
// ember-js and ember-data? - How to access selectedTable.tab.tabItems and createRecrord | |
// Thank you |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment