We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

dialog not removed from DOM view after destroying the component which is created on-fly(dynamic components) using component Factory Resolver

Thread ID:





146440 Aug 3,2019 06:43 PM UTC Aug 7,2019 07:09 AM UTC Angular - EJ 2 3
Tags: Dialog
Asked On August 3, 2019 06:43 PM UTC


screen1 showing that dynamic component which is containing ejs-dialog is created on fly:

Dynamic component (html part):

browser console part which showing repeatedly adding ejs-dialog part:

Why i am trying this:
We required a confirmation box through out the application.So i am creating a component which contains ejs-dialog on fly using component resolver and destroying after
closing it.For any component other than dialog is removed from DOM ,or atleast not appending to DOM.

Thank you.

Narayanasamy Panneer Selvam [Syncfusion]
Replied On August 7, 2019 02:05 AM UTC

Hi Goutham, 
Greetings from Syncfusion support. 
We have validated the issue with shared code block and we able to reproduce the reported issue. Dialog element not destroyed properly while use routing and dynamic component render approach and this information specified in our document. 
So, we suggest you to manually remove the dialog target element by using id selector to find element from DOM. 
Sample code: 
<ejs-dialog id="dynamicDlg"> 
let dlgEle: any = document.getElementById("dynamicDlg"); 
dlgEle && dlgEle.remove(); 
For your convenience we have prepared a sample, please get it from the below link. 
Narayanasamy P. 

Replied On August 7, 2019 06:58 AM UTC

Thank you very much,Now its working as expected.

Narayanasamy Panneer Selvam [Syncfusion]
Replied On August 7, 2019 07:09 AM UTC

Hi Goutham, 
We are glad to here that the suggested solution resolved your issue. 😊 
Narayanasamy P. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon