I have a select list that is created using this code:
{{view Ember.Select
contentBinding="App.riskCategories"
optionValuePath="content.id"
optionLabelPath="content.name"
selectionBinding="riskCategory"
class="input-medium"}}
riskCategory is a property of the App.Facility model loaded for the template, and the App.RiskCategory list is populated with this code:
App.ready = function() {
App.riskCategories = App.RiskCategory.all()
}
This works fine and populates the selection list, but only with a subset of the risk categories already loaded into the browser. If I call App.RiskCategory.find () from the browser console, the rest will be loaded and the selection list will be updated, but I can not get the code to work for this.
So I tried:
App.ready = function() {
App.riskCategories = App.RiskCategory.find()
}
or
App.ready = function() {
App.RiskCategory.find()
App.riskCategories = App.RiskCategory.all()
}
But both of them lead to the following error:
Uncaught Error: Attempted to handle event `loadedData` on <App.Facility:ember417:1> while in state rootState.loaded.updated.uncommitted. Called with undefined
, . App.RiskCategory , db. App.Facility App.RiskCategories
!