I want to retrieve tabular data related to a model and display it in a table. I am not sure how to do that in ember. Here is what I tried :
I added a get action on my API that return a json with the data
model_path\:id\related_data
I added a custom action to the model :
allShares: modelAction('all_shares',{type: 'GET'})
ANd here is how I add it to the route's model :
allShares: invoice.then((i)=>{return i.allShares()})
Now I have a model.allShares
that should contain the data. In the network inspector I can see that there has been a query to the endpoint returning the JSON data I want to display.
The following code in the view is totally blank :
I can now see a big object in the inspector (using debugger in model()) and I am not sure what to do of it, or even what type of object is it.
WHat can I do now to handle this data?
Aucun commentaire:
Enregistrer un commentaire