After attempting to implement the method described in a Stack Overflow thread on Angular CDK: How to set Inputs in a ComponentPortal, I've encountered issues with the deprecated PortalInjector
without clear guidance on what to use instead. The deprecation warning simply advises to "Use Injector.create
instead," leaving me confused about how and where to apply it and what it's meant to replace.
Additionally, I delved into Material's Dialog component in search of insights on how to handle this, but to no avail.
So, I am presenting my question again in the context of Angular 13:
How can I effectively transfer data in and out of a component created through ComponentPortal()
? If the solution involves using an Injector, could you kindly direct me to an example or documentation illustrating the process? Perhaps even a basic 'hello world' example showcasing Injector usage?