Join the Stack Overflow Community
Stack Overflow is a community of 6.8 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

This is the format of json which I need to parse:

[{
  "perAddress": {
    "city": "Delhi",
    "Street": "saket",
    "pin": "101011"
  },
  "flag": false
}, {
  "perAddress": {
    "city": "Delhi",
    "Street": "malvya",
    "pin": "101011"
  },
  "flag": true,
  "alterAddress": {
    "city": "bangalore",
    "street": "velondore",
    "pin": "560103"
  }
}];
  1. If the flag is false then the corresponding row will not be highlighted and only perAddress will be populated .

  2. If the flag is true then the corresponding row will be highlighted with containing perAddress and on click on the row the alterAddress need to populated. How to iterate through the json?

share|improve this question
    
You can use .forEach method which accepts as argument a callback function. – Alexandru-Ionut Mihai 10 mins ago
    
use angular.Foreach – Sajeetharan 10 mins ago
    
It seems json is not valid, or might be with last edit somebody just altered. – Jai 3 mins ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.