I have an EAK app which I upgraded for ember 1.10 and am now attempting to migrate to CLI. In my Route model(), I assemble 2 data objects in ‘requests’, then pass that into Promise.all() to be returned in a new object. EAK uses api-stub, but with CLI I’m using ‘ember-cli-api-stub-static’ and I’ve confirmed that the JSON data is served up. With this framework I often get ‘error for this or that’ with no clue as to why. What is it about CLI that makes this block of code fail to work? How can I debug to find the root cause?
model: function(params){
var requests = [
new Ember.RSVP.Promise(function(resolve, reject){
Ember.$.getJSON('/ota/desc').done(function(data){
resolve(Ember.Object.create(data));
}).fail(function(error){
reject(error);
});
}),
new Ember.RSVP.Promise(function(resolve,reject){
Ember.$.getJSON('/api/configuration').done(function(data){
resolve(Ember.Object.create(data));
}).fail(function(error){
reject(error);
});
})
];
return Ember.RSVP.Promise.all(requests, "Resolving data")
.then(function (data) {
return Ember.Object.create({
descriptiveContents: data[0],
configuration: data[1]
});
});
}