In a page I have two radio buttons and the two radio buttons produce different results:
First button is about Student Details. My json array looks like this :
[{"Name":"A", "Class":"x", "Section":"abcd", "DOB": "XYZ"},
{"Name":"B", "Class":"x", "Section":"abcd", "DOB": "XYZ"},
{"Name":"C", "Class":"x", "Section":"abcd", "DOB": "XYZ"},
{"Name":"D", "Class":"x", "Section":"abcd", "DOB": "XYZ"}]
My second button is academic details. My json array looks like this :
[{"Name":"A", "Language":"x", "English":"90", "Maths": "90"},
{"Name":"B", "Language":"x", "English":"80", "Maths": "80"},
{"Name":"C", "Language":"x", "English":"70", "Maths": "70"},
{"Name":"D", "Language":"x", "English":"60", "Maths": "60"}]
Previously I followed code similar like this
<body>
<div ng-app="" ng-init='names = [{"Name":"A", "Class":"x", "Section":"abcd", "DOB": "XYZ"},
{"Name ":"B ", "Class ":"x ", "Section ":"abcd ", "DOB ": "XYZ "},
{"Name ":"C ", "Class ":"x ", "Section ":"abcd ", "DOB ": "XYZ "},
{"Name ":"D ", "Class ":"x ", "Section ":"abcd ", "DOB ": "XYZ "}];'>
<table border="2px">
<tr>
<th>
Name
</th>
<th>
Class
</th>
<th>
Section
</th>
<th>
DOB
</th>
</tr>
<tr ng-repeat="x in names">
<td>
{{ x.Name}}
</td>
<td>
{{x.Class}}
</td>
<td>
{{x. Section}}
</td>
<td>
{{x. DOB}}
</td>
</tr>
</table>
</div>
</body>
But now the table columns and table values differs. With the output json, I have to build table dynamically since table column name cannot be defined.
Could anyone help with this?