title: How to order data in ng-repeat with nested objects as JSON data in angular js
body: <p>i want to show array of object's properties in angular view. following is the object</p>
  
  <pre><code>$scope._Json = {
      "foo": {
          "ItemDimension1": {
              "Item": "item1",
              "ItemIndex": 1,
              "SelectedItems": [{
  
                  "Code": "Code1" 
              }]
          }
      },
      "bar": {
          "ItemDimension2": {
              "Item": "item2",
               "ItemIndex": 3,
              "SelectedItems": [{
  
                  "Code": "code2" 
              }]
          },
          "ItemDimension3": {
              "Item": "item3",
              "ItemIndex": 2,
              "SelectedItems": [{
  
                  "Code": "Code3" 
              }]
          }
      },
      "Lorem": {
          "ItemDimension4": {
             "Item": "item4",
              "ItemIndex": 5,
              "SelectedItems": [{
  
                  "Code": "Code4" 
              }]
          }
      }
    };
  </code></pre>
  
  <p>I want to show this in view like </p>
  
  <p>item1 - 1</p>
  
  <p>item3 - 2</p>
  
  <p>item2 - 3</p>
  
  <p>item4 - 5</p>
  
  <p>but it is showing like</p>
  
  <p>item4 - 5</p>
  
  <p>item2 - 3</p>
  
  <p>item3 - 2</p>
  
  <p>item1 - 1</p>
  
  <p>in view template</p>
  
  <pre><code>&lt;label ng-repeat="(catagory, items) in _Json"&gt;
            &lt;li ng-repeat="(name, itemslist) in items | orderBy:'itemslist.ItemIndex'"&gt;
  
                &lt;strong&gt;{{itemslist.Item }}&lt;/strong&gt; - &lt;strong&gt;{{itemslist.ItemIndex }}&lt;/strong&gt; 
  
              &lt;/li&gt;
         &lt;/label&gt;
  </code></pre>
  
  <p>how to order this with ItemIndex ?</p>
  
  <p>is this a proper method ? or do i want to change something?</p>
  
  <p>with respect to <a href="https://stackoverflow.com/questions/23920028/angularjs-orderby-on-ng-repeat-doesnt-work?answertab=active#tab-top">Angularjs OrderBy on ng-repeat doesn&#39;t work</a> i have tried orderByobject but didnt wrk</p>
  
  <p>check this Plunker source</p>
  
  <p><a href="http://plnkr.co/edit/UCnrGJjLLaEjP7K5geV0?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/UCnrGJjLLaEjP7K5geV0?p=preview</a></p>