var App = Ember.Application.create({
loaded:function(){
async(function(result) {
data = SomeModel.create(result);
App.model = data;
console.log(data, App.model); //Output: <Object>,undefined
});
}
});
I have the above code snippet. App.loaded is called from an async call completion. It makes another async call within it.
I am trying to append the response to the App itself. But that doesn’t work. Data is defined and an Object but App.model is undefined.
Any pointers?
I figured it out. You need to set ‘model’ on App as its an Ember.Object
You cant directly append a key to an Ember Object like