Footer in Dynamic Dialog #113
-
Is there a way to add footer with buttons in PrimeNg Dynamic Dialog. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Hi, Unfortunately, you can only add the footer in string format to the dynamic dialog. For now, the dynamic dialog doesn't have templating support. However, you can achieve a similar thing by creating your own custom dynamic dialog with Dialog component. The process would be similar to this: 1-) Create a separate component |
Beta Was this translation helpful? Give feedback.
-
I solved this for me with Teleport. |
Beta Was this translation helpful? Give feedback.
-
How can I get access from footer component to main component data, for example if form is not valid disable buttons in footer component. Can't figure out how to do that. |
Beta Was this translation helpful? Give feedback.
-
DynamicDialog supports templating now with sub-components. Please see the example: https://primeng.org/dynamicdialog#example |
Beta Was this translation helpful? Give feedback.
Hi,
Unfortunately, you can only add the footer in string format to the dynamic dialog. For now, the dynamic dialog doesn't have templating support. However, you can achieve a similar thing by creating your own custom dynamic dialog with Dialog component. The process would be similar to this:
1-) Create a separate component
2-) In here by using dialog component and templating feature, you can implement desired customizations.
3-) Dynamically create this component by using Angular's viewContainerRef
4-) Create a service for injection if you want to subscribe open/close or want to use any events.