Hi. We have a dynamic component to add/remove elements dynamically . When adding elements, we call BindingEngine.enhance() after insert an element in DOM, that makes attached() method of the added component called successfully. We want to get detached() called when removing an element in DOM as well. Is there a way to achieve it?
Take a look at this issue for a workaround https://github.com/aurelia/framework/issues/714
.enhance from either
TemplatingEngine will return you a view. For that, you can call
detached on it yourself.
const view = this.templatingEngine.enhance(...); ... view.detached();