ruby on rails 4 - Dispaly JSON response from the server to handle bar templates in Ember CLI -
my json api server
i getting api response server. how display json in template.
{ past_bills: [ { id:1, status: "success", count: 3, subscribers: [ { subscriberid: 100168, count: 3, invoices: [ { invoiceyear: "2014", invoicemonth: "1", link: "https://invoices.test.com/a6034c05-c9be-4a1a-9741-1e07b04f47bb/100168_3935_2014_02_invoice.pdf" }, { invoiceyear: "2014", invoicemonth: "2", link: "https://invoices.test.com/00168/5c00abae-524d-4d86-a927-610646ceb56e/100168_4799_2014_03_invoice.pdf" }, { invoiceyear: "2014", invoicemonth: "3", link: "https://invoices.test.com/100168/9533058f-2348-4d67-a1d3-187bc86cf40f/100168_6054_2014_04_invoice.pdf" } ] } ] } ] }
my routes
export default ember.route.extend({ model: function(params) { this.store.find('past-bill',params); } });
my template
<table> {{#each item in model}} <tr><td>hiii</td></tr> {{/each}} </table>
my model file
import ds 'ember-data'; export default ds.model.extend({ status: ds.attr(), count: ds.attr(), subscribers: ds.attr() });
i want display response json template. tried not getting result in template.
{{#each item in model}} {{#each sub in item.subscribers}} {{#each invoice in sub.invoices}} <tr role="row"> <td>{{invoice.invoicemonth}}</td> <td>{{invoice.invoiceyear}}</td> <td><a {{bind-attr href='invoice.link'}} target="_blank">view bill</a> {{!invoice.link}}</td> </tr> {{/each}} {{/each}} {{/each}}
Comments
Post a Comment