Hi,
Im using angular 6 for developping my application.
i create 3 component with router logic.
That mean that when navigate one component to others. Html is deleted and generated.
So on each component i have each other a table that they get initialize in the function ngOnInit.
Each other have different options and different ajax sources routes.
Each time i navigate to a component the table make a first request to my backend.
But some how when i navigate to another component. he keeps the old ajax source data from the old data initialization and pop some alert error msg with error on colomn x to row x and data x. But the table keeps working. But the alert concern colomn data that i initialize in a old datatable options.
In the ngOnDestroy function i try $('#foo').DataTable().destroy() and $('#foo').DataTable().clear().
I try this method at the end of ngOnInit to see what happend and the table actually get destroy and data clear but like i said somehow when i navigate that spam me an error about a data that dont exist on another table.
Is there a way to add on my router logic to clear complety ajax data?
I hope you guys understand my question, thanks for the help.
*edit: somehow i cant send exemple code maybe to long and cant use playground