Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4870

GlimmerComponent's willDestroy Not Working as Expected

$
0
0
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

Read full topic


Viewing all articles
Browse latest Browse all 4870

Trending Articles