Does DynamicDialog work anymore?

UI Components for Angular
Post Reply
ekprimeng
Posts: 5
Joined: 16 Aug 2023, 22:10

31 Aug 2023, 01:55

Tried to set up a sample vLatest app using the code provided in the docs at https://primeng.org/dynamicdialog and it all works as expected, except that:

Code: Select all

this.ref.close(product);
doesn't do anything.

I can hit a breakpoint when closing the dialog via mouse clicks, but the programmatic close (critical to return a value) seems broken. There are no errors, it just doesn't do anything.

ekprimeng
Posts: 5
Joined: 16 Aug 2023, 22:10

31 Aug 2023, 06:59

To add more context, it looks like the DynamicDialogRef object getting passed to the constructor of the dialog component is not the same one that's returned from the call to dialogService.open. As a result, calls to the component's ref.close() aren't wired up to the subscribers from the calling component.

It also looks like adding a DynamicDialogConfig to the dialog component constructor results in an object that doesn't match the one passed in to dialogService.open. There doesn't appear to be any way to work around this such that the dynamic dialog can be used to return a value and/or close itself.

However, the close observables do hit when the dialog is closed via the close button in the top right corner. But this makes sense as it's all under the hood.

But this leads me back to my original question as to whether this component is still supported. For example, there is a reference to needing to configure entryComponents, but that seems outdated.

Another thing that might impact my usage here is that I adapted both components to be standalone. If that requires additional configuration, please let me know.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests