TypeError: Cannot read property 'parentNode' of null while using angular-datatables TypeError: Cannot read property 'parentNode' of null while using angular-datatables angularjs angularjs

TypeError: Cannot read property 'parentNode' of null while using angular-datatables


Please see the comment of Mr.MaicolBen here. It may help.

"The table haven't plugins, it seems to me that the table is not ready when the directive is applied. Because when I create other directive that apply the plugin after a second work! But the behavior is slow:"

.directive('myDatatable', function($compile, $timeout){    return function(scope, elem, attr) {        $timeout(function(){            elem.attr('datatable', 'ng');            elem.removeAttr('my-datatable');            $compile(elem)(scope);        }, 1000);  };})