title: Passing data to and from a ComponentPortal in Angular CDK
body: <p>I have tried to use the method found at <a href="https://stackoverflow.com/questions/47469844/angular-cdk-how-to-set-inputs-in-a-componentportal">Angular CDK: How to set Inputs in a ComponentPortal</a>
  but <code>PortalInjector</code> seems to be deprecated, with no actual instructions on what to do in its place. The deprecation warning states to &quot;Use <code>Injector.create</code> instead.&quot; with but not how or where to use it or what it's actually replacing.</p>
  <p>I have also tried to wrap my head around <a href="https://github.com/angular/components/blob/97ec228ada31e55f76a7e0171c715bb0b8d07e9c/src/material/dialog/dialog.ts#L313" rel="nofollow noreferrer">Material's own Dialog component</a> to see if I could figure out how they did it, but nothing.</p>
  <p><strong>So I pose the question again for Angular 13</strong>:</p>
  <p>How can I pass data into and out of a component that was created using a <code>ComponentPortal()</code>? If the answer is something generic such as using an Injector, can you please point me to an example or documentation on how to do so? A 'hello world' of passing Injectors?</p>