title: angularjs ng-repeat not showing my data in ng-model
body: <p>I have this</p>
  
  <pre><code>ng-repeat="directive in vm.directives"&gt;
  </code></pre>
  
  <p>in which that loop properly displays all of my data</p>
  
  <p>Inside that loop i can do this</p>
  
  <pre><code>{{vm.question.directiveassoc[0].SortOrder}}
  </code></pre>
  
  <p>and that works</p>
  
  <p>but when i try to do </p>
  
  <pre><code>{{vm.question.directiveassoc[directive.Id].SortOrder}}  that does not work
  </code></pre>
  
  <p>nor more importantly I want my ng-model to display the data in my object</p>
  
  <pre><code>ng-model="vm.question.directiveassoc[directive.Id].SortOrder"
  </code></pre>
  
  <p>Why doesn't that work , shouldn't it display data from my object?</p>
  
  <pre><code>{
    "Id": 105,
    "Name": "yyyyyyyyyyyyy",
    "Description": "yyyyyyyyyyyyyy",
    "Active": true,
    "$$hashKey": "object:98",
    "directiveassoc": [
      {
        "Id": 96,
        "QuestionId": 105,
        "DirectiveId": 1,
        "SortOrder": 99,
        "data": "yyyyyy"
      }
    ]
  }
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>Ok,  this works</p>
  
  <pre><code>   ng-model="vm.question.directiveassoc[directive.Id -1].SortOrder"
  </code></pre>
  
  <p>Problem is that looping over vm.directives  , is a list of objects that start with 1 ,  since they are in order   1 to many ,   and since my other object of vm.question.directiveassoc contains the same directive id , along with sortorder ..  that works if i -1</p>
  
  <p>So since object starts with 0 , i just subtract </p>
  
  <p>This feels icky / hacky  though</p>
  
  <p><strong>What is a better way to really do this loop with different objects?</strong></p>