overview.hbs
{{#in-element this.filterContainer}}
<TimeFilter @id="page-time-filter"/>
{{/in-element}}
timeFilter.js
willDestroy() {
const element = document.getElementById(this.timePickerId);
console.log("willDestroy element=> ", element); // Returns null
if (element) {
window.MyComponents.datetimerangepicker(element).destroy();
}
}
In the timeFilter.js willDestroy method, the element returns null. The time filter component’s elements are removed before willDestroy is triggered, so the MyComponents destroy() method cannot be performed. I want to call the MyComponents destroy() method before the component is destroyed.
3 posts - 3 participants