title: Group elements by object property in Angular
body: <p>In Ionic 4 (Angular), I want to create a div for each unique 'type' property of the items and add all elements with the same 'type' under the said div.</p>
  
  <p>For example, I want to output the following array:</p>
  
  <pre><code>items = [
        {
          type: 'type1',
          question: 'question1',
          answer: 'answer1'
        },
        {
          type: 'type2',
          question: 'question2',
          answer: 'answer2'
        },
        {
          type: 'type2',
          question: 'question3',
          answer: 'answer3'
        },
        {
          type: 'type3',
          question: 'question4',
          answer: 'answer4'
        },
      ];
  </code></pre>
  
  <p>as this:</p>
  
  <pre><code>&lt;div id="type1"&gt;
     &lt;div class="item"&gt;
         &lt;h1&gt;question1&lt;/h1&gt;
         &lt;div&gt;answer1&lt;/div&gt; 
     &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div id="type2"&gt;
     &lt;div class="item"&gt;
         &lt;h1&gt;question2&lt;/h1&gt;
         &lt;div&gt;answer2&lt;/div&gt; 
     &lt;/div&gt;
  
     &lt;div class="item"&gt;
         &lt;h1&gt;question3&lt;/h1&gt;
         &lt;div&gt;answer3&lt;/div&gt; 
     &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div id="type3"&gt;
     &lt;div class="item"&gt;
         &lt;h1&gt;question4&lt;/h1&gt;
         &lt;div&gt;answer4&lt;/div&gt; 
     &lt;/div&gt;
  &lt;/div&gt;
  
  </code></pre>