title: how to change JSON data format in angular JS?
body: <p>I am new to Angular JS.</p>
  
  <p>My JSON data is:</p>
  
  <pre><code>{
  "CheckList": [
     {
      "UnitClass": "Budget Space",
      "CheckListCategoryId": 1,
      "CheckListCategory": "DOORS",
      "CheckListItemId": 2,
      "CheckListItem": "Deadbolt, Locksets, and keys all functioning"
     }, 
     {
      "UnitClass": "Budget Space",
      "CheckListCategoryId": 2,
      "CheckListCategory": "WINDOWS",
      "CheckListItemId": 46,
      "CheckListItem": "Windows are operable"
     }, 
     {
      "UnitClass": "Budget Space",
      "CheckListCategoryId": 2,
      "CheckListCategory": "WINDOWS",
      "CheckListItemId": 13,
      "CheckListItem": "Window pane is not broken or cracked"
     }
  }
  </code></pre>
  
  <p>And I want to change it to:</p>
  
  <pre><code>{
  "CheckList": [
     {
      "UnitClass": "Budget Space",
      "CheckListCategoryId": 1,
      "CheckListCategory": "DOORS",
      "CheckListItemId": 2,
      "CheckListItem": "Deadbolt, Locksets, and keys all functioning"
     }, 
     {
      "UnitClass": "Budget Space",
      "CheckListCategoryId": 2,
      "CheckListCategory": "WINDOWS",
      "CheckListItems": [
          {
              "CheckListItem": "Windows are operable",
              "CheckListItemId": 46,
          },
          {
              "CheckListItem": "Window pane is not broken or cracked",
              "CheckListItemId": 13,
          }]
     }
  }
  </code></pre>
  
  <p>Why I am doing this:</p>
  
  <p>I have a Bootstrap collapse list as</p>
  
  <p>DOORS<br>
  WINDOWS</p>
  
  <p>which i am getting using ng-repeat, adding a filter 'unique' on <code>CheckListCategoryId</code></p>
  
  <p>But the problem is with my current JSON, only single <code>CheckListItem</code> is getting posted but in many cases there are two. like in WINDOWS.</p>
  
  <p>How to change the JSON data??</p>
  
  <p>One more thing.
  Is my current way correct or there is any other alternative??</p>