On the overview-products page I select a product that I would like to order,
after that I go to the configure-product page
and when the product is configured, I go to the overview page
Now, my OrderOverviewRoute is like this (short version):
App.OrderOverviewRoute = Ember.Route.extend({
model: function(params) {
var order = this.modelFor('order');
var items = [];
var products = this.store.find('product');
// OTHER STUFF
}
});
The problem I’m now having is that products is always empty. Which shouldn’t be the case because I can see on my backend that an API call was made and that all products were returned.
Am I doing something wrong? Because I’m pretty much doing the exact same thing as I’m doing in my OverviewProductsRoute, where it does work.
Hm, this is very strange. You see the data coming in your browser’s dev tools but that line (I suppose you only forgot the console.log in your example above) prints “0” in the console?
Well I’m not seeing it in the dev tools that the data gets returned from my service. But I’m testing against an apiary test service and they have a traffic monitoring tool. So that’s how I know that I’m getting the data back correctly.
The strange thing is that when I go through the code step by step, I can see that at a certain point I have an array with my data. But that data is getting lost somewhere for reasons unknown.