title: Angular ng-repeat conditional wrap items in element (group items in ng-repeat)
body: <p>I'm trying to group the items in a ng-repeat using a condition.</p>
  
  <p>An example condition is to group all elements with the same hour.</p>
  
  <p>The data:</p>
  
  <pre><code>[
      {name: 'AAA', time: '12:05'},
      {name: 'BBB', time: '12:10'},
      {name: 'CCC', time: '13:20'},
      {name: 'DDD', time: '13:30'},
      {name: 'EEE', time: '13:40'},
      ...
  ]
  </code></pre>
  
  <p>The 'time' field is actually a timestamp (1399372207) but with the exact time the example output is easier to understand.</p>
  
  <p>I am listing these items using ng-repeat:</p>
  
  <pre><code>&lt;div ng-repeat="r in data| orderBy:sort:direction"&gt;
     &lt;p&gt;{{r.name}}&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>also tried with:</p>
  
  <pre><code>&lt;div ng-repeat-start="r in data| orderBy:sort:direction"&gt;&lt;/div&gt;
      &lt;p&gt;{{r.name}}&lt;/p&gt;
  &lt;div ng-repeat-end&gt;&lt;/div&gt;
  </code></pre>
  
  <p>A valid output is:</p>
  
  <pre><code>&lt;div class="group-class"&gt;
      &lt;div&gt;&lt;p&gt;AAA&lt;/p&gt;&lt;/div&gt;
      &lt;div&gt;&lt;p&gt;BBB&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="group-class"&gt;
      &lt;div&gt;&lt;p&gt;CCC&lt;/p&gt;&lt;/div&gt;
      &lt;div&gt;&lt;p&gt;DDD&lt;/p&gt;&lt;/div&gt;
      &lt;div&gt;&lt;p&gt;EEE&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My last option if there isn't a simple solution for my problem would be to group the data and then assign it to the scope variable used in ng-repeat.</p>
  
  <p>Any thoughts?</p>