title: Is there a way to only show an iframe element when present in an object in Angular?
body: <p>I am trying to find a way to display only the <code>iframe</code> element of some HTML that is being delivered to my Angular app.</p>
  <p>In my template, I can use a <code>*ngIf</code> to see if there is the tag present, but I am unaware of way to only show the iframe from the object, and not the rest of the HTML.</p>
  <pre><code>&lt;div *ngIf=&quot;item.content.indexOf('iframe') &gt; 0&quot; class=&quot;item&quot;&gt;
     &lt;div (click)=&quot;this.navigateToPost(item.id)&quot;&gt;
        &lt;h2 [innerHTML]=&quot;item.title&quot;&gt;&lt;/h2&gt;
     &lt;/div&gt;
     &lt;div class=&quot;iframe-container&quot;[innerHTML]=&quot;this.sanitized.bypassSecurityTrustHtml(item.content)&quot;&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>In my <code>&lt;div class=&quot;iframe-container&quot;[innerHTML]=&quot;this.sanitized.bypassSecurityTrustHtml(item.content)&quot;&gt;&lt;/div&gt;</code> I would like to find way to only show the iframe code in the <code>item.content</code>.</p>
  <p>Does anyone happen know of a good approach to handle this?</p>