title: AngularJS ng-repeat conditionals
body: <p>I have an array of JS objects (eg paragraphs in a document) and I want to display them using angularJS.  <code>ng-repeat</code> appears to be the directive I need:</p>
  
  <p><code>&lt;span ng-repeat="paragraph in paragraphs"&gt;{{paragraph.text}}&lt;/span&gt;</code></p>
  
  <p>However, I need to do more than just display their contents in this loop.  I need to insert page breaks (just for visual purposes, eg: <code>&lt;div class="pagebreak" /&gt;</code>) after <code>x</code> pixels (attempting WYSIWYG document).</p>
  
  <p><strong>My Question</strong>:</p>
  
  <p>Is it possible to have some kind of conditional logic to count how many pixels the previous paragraphs have used vertically, and if it is more than <code>x</code>, insert a pagebreak <code>div</code> and reset the counter?</p>
  
  <p>Any help/advice/direction much appreciated.</p>