Skip to content

Commit cb42a05

Browse files
committed
solve "blank page after reload in angular way" issue
solve "blank page after reload in angular way" issue Ref: l-lin#262 (comment)
1 parent 8635e36 commit cb42a05

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dist/angular-datatables.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ function dtNGRenderer($log, $q, $compile, $timeout, DTRenderer, DTRendererServic
841841
function create(options) {
842842
var _staticHTML;
843843
var _oTable;
844+
var _newValue;
844845
var _$elem;
845846
var _parentScope;
846847
var _newParentScope;
@@ -873,9 +874,11 @@ function dtNGRenderer($log, $q, $compile, $timeout, DTRenderer, DTRendererServic
873874

874875
var _alreadyRendered = false;
875876

876-
_parentScope.$watchCollection(_ngRepeatAttr, function() {
877+
_parentScope.$watchCollection(_ngRepeatAttr, function(newValue) {
877878
if (_oTable && _alreadyRendered) {
878-
_destroyAndCompile();
879+
if(_newValue !== newValue) {
880+
_destroyAndCompile();
881+
}
879882
}
880883
$timeout(function() {
881884
_alreadyRendered = true;
@@ -1321,4 +1324,4 @@ function dtPropertyUtil($q) {
13211324
dtPropertyUtil.$inject = ['$q'];
13221325

13231326

1324-
})(window, document, jQuery, angular);
1327+
})(window, document, jQuery, angular);

0 commit comments

Comments
 (0)