Generic URL and multiple data in one route


#1

In my detail page which is “pic” route, I print the clicked news’ picture’s bigger version and its content.I take them from service as JSON. Also, I’m using generic URL. You can check my twiddle here:

https://ember-twiddle.com/b9cd8b1b3418d876f88235c4aa99e268?openFiles=templates.pic.hbs%2Ctemplates.components.image-list.hbs

How am I gonna add two more little pics,to the bottom right of the page which are next 2 news’ links? If I use “model.blahblah” it only gives me the one I selected. Is there any other way?

I searched on the internet but all I found was about using 2 or 3 different models. I have only one, which takes data from service.

Can anybody help me?

Am I making a mistake by not using Ember-Data? Thanks.


#2

Your API could return it as a related attribute http://jsonapi.org/format/#fetching-pagination or, if you couldn’t change the API, add some transformation before return your json in service class.

What do you think about these options ?


#3

Thanks for the response @heatbr , but it’s not so clear for me because I’m so new at both JSON and Ember things. I don’t think I can change the API because It will be given to me from the backend in the future… Can you be more spesific about the other option, please?