Angular 2 conditional ngFor : <p>I'm trying to clean up my template code. I have the following:</p>

<pre><code>&lt;ul&gt;
  &lt;li *ngIf="condition" *ngFor="let a of array1"&gt;
    &lt;p&gt;{{a.firstname}}&lt;/p&gt;
    &lt;p&gt;{{a.lastname}}&lt;/p&gt;
  &lt;/li&gt;
  &lt;li *ngIf="!condition" *ngFor="let b of array2"&gt;
    &lt;p&gt;{{b.firstname}}&lt;/p&gt;
    &lt;p&gt;{{b.lastname}}&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>Is there a way to conditionally pick <code>array1</code> or <code>array2</code> to iterate through using <code>*ngIf</code> or something so that I don't have to repeat so much template code? This is just an example; my actual <code>&lt;li&gt;</code> contains a lot more content so I really don't want to repeat myself. Thanks!</p>
