title: How to change/add field in JSON structure in angularjs/javascript
body: <p>i am using angularjs http get method to get the data,the JSON format which i am getting is :</p>
  
  <pre><code>{"SITE1":[
      {
          "name":"name1",
          "status":"0",
          "id":23,
          "isDeleted":false
      },
      {
          "name":"name2",
          "status":"0",
          "id":13,
          "isDeleted":false
      }],
  
  "SITE2":[
      {
          "name":"name3",
          "status":"0",
          "id":2,
          "isDeleted":false
      }
      ]}
  </code></pre>
  
  <p>but i want data to be in format </p>
  
  <pre><code>{"location" : "SITE1",
   "services" : [
        {
          "name":"name1",
          "status":"0",
          "id":23,
          "isDeleted":false
        },
        {
          "name":"name2",
          "status":"0",
          "id":13,
          "isDeleted":false
        }],
     "location" : "SITE2",
      "services":[
         {
          "name":"name3",
          "status":"0",
          "id":2,
          "isDeleted":false
         }
      ]}
  </code></pre>
  
  <p>Please help in this, how to do this. 
  I tried using</p>
  
  <pre><code>object["location"] = key;
   object["status"] = value;
  </code></pre>
  
  <p>to add these fields. but something is going wrong in this. </p>