How to check type of variable in ngIf in Angular2
<p>I'm learning Angular2. I have a component with a variable which is an object.
I'm iterating over the fields of the object, and acording to the type of data of that position, I need to render a different compoenent.
In this case, I want tu render that <code>label</code> if the <code>typeof</code> that position is a <code>number</code> how ever this is not working</p>

<pre><code>&lt;div&gt;
  &lt;div *ngIf='obj'&gt;
    &lt;label *ngFor="let key of keys; let i = index"&gt;
      &lt;label class='key'&gt;{{key}}:&lt;/label&gt;
      &lt;label class='number' *ngIf='typeof obj[key] === "number"'&gt;
      &lt;!-- label class='number' *ngIf='obj[key] | typeof === "number"' --&gt;
        {{ obj[key] }}
      &lt;/label&gt;
    &lt;/label&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>Any ideas?</p>

<p>I have also created a pipe to get the <code>typeof</code> which work when I print the value, but not inside the *ngIf</p>