title: How to access a component reference in [cdkPortalOutlet]
body: <p>I'm implementing Angular's CDK portals to load up dynamic components.
  I'm able to load the components onto the page really quickly and easily using the given html, and app.ts.</p>
  
  <p>Once I've loaded the component, I'd like to access it's interface method <em>doSomething()</em>, however I don't seem to have access to the component that has been loaded.</p>
  
  <p><strong>Is it possible to access this component?</strong></p>
  
  <hr>
  
  <p><strong>Classes/Interface:</strong></p>
  
  <pre><code>interface IPortalThing {
      doSomething(){...}
  }
  class PortalThingComponent
  class OtherPortalComponent
  </code></pre>
  
  <p><strong>Html:</strong></p>
  
  <pre><code>&lt;ng-template [cdkPortalOutlet]="portal"&gt;&lt;/ng-template&gt;
  </code></pre>
  
  <p><strong>App.ts</strong></p>
  
  <pre><code>portal: Portal&lt;any&gt;;
  ...
  
  loadComponent() {
      this.portal =  new ComponentPortal(PortalThingComponent));
  }
  </code></pre>
  
  <hr>
  
  <p>I have tried to give an indication of type through the following:</p>
  
  <pre><code>portal: Portal&lt;IPortalThing&gt;;
  ...
  
  loadComponent() {
      this.portal =  new ComponentPortal&lt;IPortalThing&gt;(PortalThingComponent));
  }
  </code></pre>
  
  <p>However, doing this makes me unable to set my this.portal due to the following error:</p>
  
  <pre><code>Type 'ComponentPortal&lt;IPortalThing&gt;' is not assignable to type Portal&lt;IPortalThing&gt;'.
  </code></pre>
  
  <p>Which I found puzzling.</p>