I have been reading through the Lightning Developer Guide. Could someone tell me if it is possible to remove a Lightning Component from the DOM? The use case I have is that I am displaying a success or error message based on a record update in Salesforce. I have that error message showing for 5 seconds, and then it will automatically be removed from the body of the
<div> where I inserted it. However, it still remains in the DOM. I am using the
$A.createComponent() method to create the
ui:message component dynamically and was thinking that I would want to remove it from the DOM so that new ui:message components are not continually added each time.
Could someone provide some insight?