Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Fix problem when data refreshed the "Angular way" #326

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dist/angular-datatables.js
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ function dtNGRenderer($log, $q, $compile, $timeout, DTRenderer, DTRendererServic
var _oTable;
var _$elem;
var _parentScope;
var _newParentScope;
var dtInstance;
var renderer = Object.create(DTRenderer);
renderer.name = 'DTNGRenderer';
Expand Down Expand Up @@ -959,10 +960,14 @@ function dtNGRenderer($log, $q, $compile, $timeout, DTRenderer, DTRendererServic
}

function _destroyAndCompile() {
if (_newParentScope) {
_newParentScope.$destroy();
}
_oTable.ngDestroy();
// Re-compile because we lost the angular binding to the existing data
_$elem.html(_staticHTML);
$compile(_$elem.contents())(_parentScope);
_newParentScope = _parentScope.$new();
$compile(_$elem.contents())(_newParentScope);
}
}
}
Expand Down
Loading