title: ng-repeat show only last element
body: <p>I am developing inbox for messages with AngularJs, and I came across one issue: I want to show only last element within <code>ng-repeat</code>. I did some research, and found out that the code below should work. </p>
  
  <pre><code>&lt;div class="inbox" ng-repeat="recipient in messages"&gt;
    &lt;ul&gt;
      &lt;div&gt; 
        &lt;span&gt; {{recipient.$id}} &lt;br&gt; &lt;/span&gt;
        &lt;li class="inboxItem"&gt;
          &lt;span ng-repeat="messages in recipient"&gt; {{messages.sender}} {{messages.message}} &lt;br&gt;&lt;/span&gt;
        &lt;/li&gt;
      &lt;/div&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>However, it does not. Can you guys tell me what am I doing wrong? I thought that <code>array.length-1</code> should limit ng-repeat to show only the last object in an array.</p>
  
  <p>Thanks!</p>