component using angular datatable and dttrigger when switch between components it gives error of ObjectUnsubscribedError because of dttriggers.next()
See original GitHub issuererender(): void {
this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => {
// Destroy the table first
dtInstance.destroy();
// Call the dtTriggers to rerender again
this.dtTriggers.next();
});
}
ngOnDestroy(){
console.log("dashboard destroy is called");
this.dtTriggers.unsubscribe();
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
ERROR ObjectUnsubscribedErrorImpl in using angular ...
This error usually signifies that the subscriber or the main method is modified by some other code which led it to unsubscribing.
Read more >Objectunsubscribederror Because Of Dttriggersnext 1241 ...
Starter project for Angular apps that exports to the Angular CLI.
Read more >Cannot refresh datatable when select option in dropdown menu
Hello, I just started using datatable in one of my Angular 6 project, and I'm really lost when it gets to refresh my...
Read more >Angular 2 — ObjectUnsubscribedError Woes - Medium
Because the Subject can subscribe, it makes sense for it to have an unsubscribe() function to signal it's done, right? And if it's...
Read more >What is dtTrigger in Angular 6? - Quora
dtTrigger is part of angular datatables packages (Angular DataTables), it is created as an object inside an Angular 6+ component with the following...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe need to create a component and in component use your directive?
ngIf = false
hide the component and destroy DOM.ngIf = true
reinitialize the component and create new DOM. The component creates newdtTrigger
.I tried to use the
[hidden]
, but it is showing me errorDataTables warning: table id=releaseDatatable - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3