I encountered an issue with using resizeObserver to detect when a table changes its size and execute a function. It works correctly when the page is reloaded, but if you navigate away from the page and then go back, the resizeObserver stops working. This is my TypeScript code:
ngOnInit() {
let elem = document.getElementById('table')
let resizeObserver = new ResizeObserver(() => {
console.log('table size changed')
});
resizeObserver.observe(elem);
}
This is the HTML element I am referring to:
<ngx-datatable
id="table">
...
</ngxdatatable>