Given a data structure in TableController:
var obj = {
titles : {
title: 'Title'
, data : ['a title' , 'another title', 'look a title', 'and another']
}
, other-prop : {
title: 'Other Prop'
, data : [3030, 849875, 8888, 48484]
}
}
this.obj = obj;
if your goal was to create a table like:
table
thead
tr
th "Title"
th "Other Prop"
tbody
tr
td "a title"
td "3030"
tr
td "another title"
td "849875"
tr
td "look a title"
td "8888"
tr
td "and another"
td "48484"
How would you structure the ng-repeats? Right now I have:
div [controller="TableController as table"]
table
thead
tr
th [ng-repeat = "(key, value) in table.obj"]
tbody
tr [ng-repeat = "(key, value) in table.obj"
td [ng-repeat="(key, val) in table.obj track by $index"] "{{value.data}}"
Which is giving me...
table
thead
tr
th "Title"
th "Other Prop"
tbody
tr
td "['a title' , 'another title', 'look a title', 'and another']"
td "[3030, 849875, 8888, 48484]"
tr
td "['a title' , 'another title', 'look a title', 'and another']"
td "[3030, 849875, 8888, 48484]"
... So I'm close but I cant get... the objects to list in the correct direction.
Anyone?