Given a json of array of objects, how could one display it using a ng-repeat dynamically? error key is static / always remain the same. Just the values of error changes. So if I have the password field errored-out then I'll have password key instead on the error
{
"error": {
"firstName": {
"0": "The first name field is required.",
"1": "The first name field must have 2-5 characters."
},
"lastName": {
"0": "The last name field is required."
}
}
}
.
{
"error": {
"password": {
"0": "The password field is required."
}
}
}
I tried doing:
<ul ng-repeat="message in errormessage">
<li ng-repeat="(k,v) in message">
{{k}} - {{v}}
</li>
</ul>
But it displays this instead:
0 - [
0 - ]