title: angular.js ng-repeat division
body: <p>I have array of categories that has this structure:</p>
  
  <pre><code>{
  name: 'something',
  main_category: 'A'
  }
  </code></pre>
  
  <p>So each category has it's main category. I would like to display all categories in html like so:</p>
  
  <pre><code>&lt;h1&gt;A&lt;/h1&gt;
  &lt;ul&gt;
  &lt;li&gt;list of categories that has main category A&lt;/li&gt;
  &lt;/ul&gt;
  &lt;h1&gt;B&lt;/h1&gt;
  &lt;ul&gt;
  &lt;li&gt;list of categories that has main category B&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>how should I achieve it? The only way I found was doing something like this:</p>
  
  <pre><code>&lt;h1&gt;A&lt;/h1&gt;
  &lt;ul&gt;
  &lt;li ng-repeat="category in categories" ng-if="category.main_category == 'A'"&gt;..&lt;/li&gt;
  &lt;/ul&gt;
  &lt;h1&gt;B&lt;/h1&gt;
  &lt;ul&gt;
  &lt;li ng-repeat="category in categories" ng-if="category.main_category == 'B'"&gt;..&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>It works but I don't think it's a good idea.</p>