title: Comma separated list using angular ngfor and ngif
body: <p>I have a comma separated list that displays an array of four items.</p>
  
  <p>What I'm trying to do is this:</p>
  
  <pre><code>item1
  item1, item2
  item1, item2, item3
  item1, item2, item3, item4 ...
  </code></pre>
  
  <p>What is happening is this:</p>
  
  <pre><code>item1,
  item1, item2,
  item1, item2, item3,
  item1, item2, item3, item4 ...
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;span *ngFor="let item of record.referrerItemList; let i=index"&gt;
      &lt;span *ngIf="i &lt;= 3"&gt;{{item}}&lt;/span&gt;&lt;span class="list-format" *ngIf="i &lt; 3"&gt;&amp;#44;&amp;nbsp;&lt;/span&gt;
      &lt;span *ngIf="(i &gt; 3) &amp;&amp; (i &lt; 5)" class="hellip-format"&gt;&amp;hellip;&lt;/span&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>Here is some list results:</p>
  
  <pre><code>Item1,  Item2,  Item3,  Item4 …
  Item1, 
  Item1,  Item2,  Item3,  Item4 …
  Item1,  Item2, 
  </code></pre>