Hi,
I’m trying to handle ajax error when I load data from an API in a route. Here is my code:
export default Ember.Route.extend({
model: function()
return Ember.$.getJSON("url/doc.json").then (function(data){
// success
return data;
}, function(){
// fail
});
});
When I try a wrong url this code never goes in the fail function. I am looking for explanations, What I don’t understand about promises?
Thank you for your help.