Skip to content
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

feat: Dynamic dialog. Child component reference to be able to #14957

Merged

Conversation

vigalo
Copy link
Contributor

@vigalo vigalo commented Mar 6, 2024

Motivation:
With the current implementation is hard to do things like use the child component public API (i.e. to populate inputs) because the component is created asynchronously and trying to pass data using the angular lifecycle hooks to access the child component throws errors because often is undefined. Pass the data through the DynamicDialogConfig is a bit tricky.

So I made generic the open method of the DialogService and DynamicDialogRef. The open method of the DialogService now returns a typed DynamicDialogRef that has a new subject (onChildComponentLoaded) where the typed component instance is emitted when loaded.

Copy link

vercel bot commented Mar 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
primeng ⬜️ Ignored (Inspect) Visit Preview Mar 14, 2024 3:00pm

@cetincakiroglu cetincakiroglu added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Mar 7, 2024
@cetincakiroglu
Copy link
Contributor

Hi,

Could you please remove other changes package, inputnumber etc. and resolve the conflicts.

@cetincakiroglu cetincakiroglu added Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated. and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Mar 20, 2024
@vigalo vigalo force-pushed the dynamicdialog-childcomponentref branch from 9edb20f to 67e1c46 Compare March 20, 2024 17:32
@vigalo
Copy link
Contributor Author

vigalo commented Mar 20, 2024

Hi,

Could you please remove other changes package, inputnumber etc. and resolve the conflicts.

Done, thanks

@rbbp23
Copy link

rbbp23 commented Mar 21, 2024

Thumbs up I would like to see this implemented as well, thanks.

@cetincakiroglu
Copy link
Contributor

Hi,

Thanks a lot for the effort and support! Could you please link the related issue with the PR if it exists or create an issue and link with the PR so it can be closed after the PR merged. I've added it to this one.

@cetincakiroglu cetincakiroglu merged commit bb64696 into primefaces:master Mar 22, 2024
2 checks passed
@cetincakiroglu cetincakiroglu removed the Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated. label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DynamicDialog | Add child component reference on component load
3 participants