Angular2 *ngIf multiple condition
<p>I am working on angular2 sample application.</p>

<p>I have added 1 menuViews object it have name, icon and url member inside it.</p>

<p>In page I am iterating that menuViews that is working fine.</p>

<p>I have some scenarios, some of url will be inner site URL like <code>../app/histoy</code>
but in some cases it is '<a href="https://play.google.com/" rel="nofollow noreferrer">https://play.google.com/</a>'</p>

<p>Following is my html code:</p>

<pre class="lang-html prettyprint-override"><code>&lt;li *ngFor="let item of menuViews"&gt;
    &lt;a class="ripple-effect" [routerLink]="[item.url]" *ngIf="isUserLoggedIn == true" &gt;             
        &lt;span class="media-body media-middle" *ngIf="isUserLoggedIn == true"&gt;{{item.name}}&lt;/span&gt;
    &lt;/a&gt;            
&lt;/li&gt;
</code></pre>

<p>so in <code>&lt;a&gt;</code> tag I want to put condition like:</p>

<pre class="lang-ts prettyprint-override"><code>if (item.url.indexOf("http://") == -1 &amp;&amp; item.url.indexOf("https://") == -1) {
    //set value in [routerLink]
} else {
    //set value in href
}
</code></pre>

<p>so kind of condition I want in this. Mainly I want to bifurcate internal and external links.</p>

<p>main problem is that, when it it external links then it tries to redirect at <code>base url + external link</code> (<code>localhost:4200#home/https://play.google.com</code>) which is wrong, so I want to manage both based on some condition.</p>

<p>Other suggestion also welcomed..</p>