title: How to access previous key/value pair in ng-repeat?
body: <p>My AngularJs app reads a json file having key/value pairs. The key/value pairs are generated by a java program using HashMap.</p>
  
  <p>I am trying to generate HTML using ng-repeat directive in AngularJs in the following manner.</p>
  
  <pre><code>&lt;li ng-repeat="(line, lineContents) in errorsFromLogFile"&gt;
      {{line}} - {{lineContents}} 
  &lt;/li&gt; 
  </code></pre>
  
  <p>I also want to access the previous (key / value) pair. </p>
  
  <p>Gone through these stackoverflow links <a href="https://stackoverflow.com/questions/15412897/how-to-obtain-previous-item-in-ng-repeat">How to obtain previous item in ng-repeat</a>, <a href="https://stackoverflow.com/questions/27776855/how-to-compare-values-inside-ng-repeat">Compare values inside ng-repeat</a> and tried to access the previous key as</p>
  
  <pre><code>{{ errorsFromLogFile[$index-1].line }} 
  </code></pre>
  
  <p>but it gives nothing. How to access previous key/value in this case?</p>
  
  <p>The json file looks like this</p>
  
  <pre><code>- errorsFromLogFile: {
       7308: "/tmp/cct7oRJm.s:2099392: Warning: .stabs: description field '11668' too big, try a different debug format",
       7309: "/tmp/cct7oRJm.s:2099393: Warning: .stabs: description field '120d3' too big, try a different debug format",
       7310: "/tmp/cct7oRJm.s:2099394: Warning: .stabs: description field '128a6' too big, try a different debug format",
       7311: "/tmp/cct7oRJm.s:2099395: Warning: .stabs: description field '13046' too big, try a different debug format",
       7312: "/tmp/cct7oRJm.s:2099396: Warning: .stabs: description field '1386c' too big, try a different debug format",
     }
  </code></pre>