@pp1994 wrote:
I have a couchDB instance which will return JSON:
[
{date: "01/01/2015", New : "hello there", Old : "bye"},
{date: "01/02/2015", Spam: "data", New : "hello again}
]I need to loop through each object in the JSON and render such that the keys in the JSON objects are headers, and the values of the JSON objects are subvalues:
<div class="card"> <div class="item item-divider"> 01/01/2015 </div> <div class="item item-text-wrap"> <b>New</b><br /> hello there. <br /> <b>Old</b><br /> bye <br /> </div> </div> <div class="card"> <div class="item item-divider"> 02/01/2015 </div> <div class="item item-text-wrap"> <b>Spam</b><br /> data <br /> <b>New</b><br /> hello again <br /> </div> </div>
I have full control over the source of JSON (reduces risk of XSS).
Is what I am trying to do possible? What is the best way to achieve this?
I have been messing around directives so far.
Posts: 1
Participants: 1