title: custom generic instanceof function
body: <p>I am performing an <code>instanceof</code> check in <code>*ngIf</code>.</p>
  
  <pre><code> &lt;span *ngFor="let element of elements"&gt; 
     &lt;app-text *ngIf="element instanceof BlueElement"&gt;&lt;/app-text&gt;
   &lt;/span&gt;
  </code></pre>
  
  <p>Unfortunately, <code>instanceof</code> cannot be used, because it is defined by javascript.</p>
  
  <p>Therefore I created my own <code>instanceOf</code> method:</p>
  
  <pre><code>  instanceOf&lt;T,C&gt;(value:T,clss:C){
      if (value instanceof C){
        return true;
      }else{
        return false;
      }
    }
  </code></pre>
  
  <p>I am getting an error; <code>C is only defined as a type, but is being used as a value here.</code></p>
  
  <p>How should I rewrite the generic <code>instanceOf()</code> function?</p>