我从数据库得到以下响应。关于类数组,其中类嵌套在组中,最后嵌套在学生中。
"Response":[
{
"Id":1,"Name":"Class 1","Location":"Building 1","Groups":[
{
"Id":1,"Name":"GB1","Students":[
{
"Id":1,"Name":"Mike","RollNo":"1","Performance":{
"Id":1,"Math":"90","Physics":"70","English":"60"
}
},{
"Id":2,"Name":"John","RollNo":"2","Performance":{
"Id":2,"Math":"90","Physics":"70","English":"60"
}
},{
"Id":3,"Name":"Muffin","RollNo":"3","Performance":{
"Id":3,"Math":"90","Physics":"90","English":"90"
}
}
]
}, {
"Id":2,"Name":"GB2","Students":[
{
"Id":4,"Name":"Ema","RollNo":"1","Performance":{
"Id":4,"Math":"90","Physics":"70","English":"60"
}
},{
"Id":5,"Name":"Sunny","RollNo":"2","Performance":{
"Id":5,"Math":"90","Physics":"70","English":"60"
}
},{
"Id":6,"Name":"Jen","RollNo":"3","Performance":{
"Id":6,"Math":"90","Physics":"90","English":"90"
}
}
]
}
]
},{
"Id":2,"Name":"Class 2","Location":"Building 1","Groups":[
{
"Id":3,"Name":"G1","Students":[
{
"Id":7,"Name":"Ron","RollNo":"1","Performance":{
"Id":7,"Math":"90","Physics":"70","English":"60"
}
},{
"Id":8,"Name":"Kaka","RollNo":"2","Performance":{
"Id":8,"Math":"90","Physics":"70","English":"60"
}
},{
"Id":9,"Name":"Mark","RollNo":"3","Performance":{
"Id":9,"Math":"90","Physics":"90","English":"90"
}
}
]
}, {
"Id":4,"Name":"G2","Students":[
{
"Id":10,"Name":"Lily","RollNo":"1","Performance":{
"Id":10,"Math":"90","Physics":"70","English":"60"
}
},{
"Id":11,"Name":"Lina","RollNo":"2","Performance":{
"Id":11,"Math":"90","Physics":"70","English":"60"
}
},{
"Id":12,"Name":"Linda","RollNo":"3","Performance":{
"Id":12,"Math":"90","Physics":"90","English":"90"
}
}
]
}
]
}
]
Now I want to create a table like this using colspan.
Could anyone help me to do this using ng-repeat and angularjs ? can't figure out how to merge this columns dynamically. So far I managed to do last part using flatten array option.