-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Allow user to provide bindings for a ComponentPortal #717
Comments
My PR #761 lets you pass an |
How injector helps to provide inputs of the component? I understand how I can provide data with custom injection token. But I will have to obtain this data by DI (using created token), but not inputs of the component. What I am missing? Does injector store information about inputs too? With that thoughts in mind (custom injection token) this question comes to the mind: how providing data via injection token (through custom injector + DI in dynamically created component) differs from passing data via service (like author used initially)? UPD: Ok, possible workaround are:
All of this ways are not looking good solutions for simple providing inputs for dynamically created components using CDK. FYI @jelbourn |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal: feature
What is the expected behavior?
A user can provide optional
ResolvedReflectiveProvider[]
to the constructor ofComponentPortal
, this is a good way to provide data for dialogs.What is the current behavior?
The component type in
ComponentPortal
use the injector of theViewContainerRef
.Dialog must use a service to get data from the application.
Before creating the component in
DomPortalHost
create a child injector with the bindings:The text was updated successfully, but these errors were encountered: