{"action":"created","issue":{"url":"https://api.github.com/repos/l-lin/angular-datatables/issues/407","labels_url":"https://api.github.com/repos/l-lin/angular-datatables/issues/407/labels{/name}","comments_url":"https://api.github.com/repos/l-lin/angular-datatables/issues/407/comments","events_url":"https://api.github.com/repos/l-lin/angular-datatables/issues/407/events","html_url":"https://github.com/l-lin/angular-datatables/issues/407","id":101244450,"number":407,"title":"Angular way having problem to destroy table","user":{"login":"yantolee","id":3691680,"avatar_url":"https://avatars.githubusercontent.com/u/3691680?v=3","gravatar_id":"","url":"https://api.github.com/users/yantolee","html_url":"https://github.com/yantolee","followers_url":"https://api.github.com/users/yantolee/followers","following_url":"https://api.github.com/users/yantolee/following{/other_user}","gists_url":"https://api.github.com/users/yantolee/gists{/gist_id}","starred_url":"https://api.github.com/users/yantolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yantolee/subscriptions","organizations_url":"https://api.github.com/users/yantolee/orgs","repos_url":"https://api.github.com/users/yantolee/repos","events_url":"https://api.github.com/users/yantolee/events{/privacy}","received_events_url":"https://api.github.com/users/yantolee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-16T09:05:38Z","updated_at":"2015-08-17T10:14:46Z","closed_at":null,"body":"I was trying to use the FixedHeader in angular way but get this error when i tried to repopulate the product data :\r\n\r\n<pre>\r\n_oTable.ngDestroy is not a function\r\n    at _destroyAndCompile (angular-datatables.js:963)\r\n</pre>\r\n\r\nHere is the snippet of the code where the error occured:\r\n\r\n<pre>\r\nfunction _destroyAndCompile() {\r\n            _oTable.ngDestroy();\r\n            // Re-compile because we lost the angular binding to the existing data\r\n            _$elem.html(_staticHTML);\r\n            $compile(_$elem.contents())(_parentScope);\r\n}\r\n</pre>\r\n\r\nHere is my controller code:\r\n\r\n<pre>\r\n<code>\r\n            $scope.vm = {};\r\n            $scope. vm.dtOptions = DTOptionsBuilder.newOptions()\r\n                .withFixedHeader(\r\n                {\r\n                    'offsetTop': 50\r\n                }\r\n            );\r\n\r\n            $scope.vm.dtInstance = {};\r\n\r\n            $scope.vm.dtColumns = [\r\n                DTColumnBuilder.newColumn('checkbox').withTitle(''),\r\n                DTColumnBuilder.newColumn('image').withTitle('Image'),\r\n                DTColumnBuilder.newColumn('name').withTitle('Product Name'),\r\n                DTColumnBuilder.newColumn('category').withTitle('Category'),\r\n                DTColumnBuilder.newColumn('price').withTitle('Price'),\r\n                DTColumnBuilder.newColumn('stock').withTitle('Stock'),\r\n                DTColumnBuilder.newColumn('dateUpdate').withTitle('Date Updated'),\r\n                DTColumnBuilder.newColumn('status').withTitle('Publish Status'),\r\n                DTColumnBuilder.newColumn('action').withTitle('Action')\r\n            ];\r\n\r\nProducts.get().$promise.then(function (data) {\r\n                    $scope.products = data;\r\n                });\r\n</code>\r\n</pre>\r\n\r\nAnd this is my html code\r\n\r\n<div class=\"highlight highlight-html\">\r\n    <pre>&lt;<span class=\"pl-ent\">table</span> <span class=\"pl-e\">id</span>=<span class=\"pl-s\"><span\r\n            class=\"pl-pds\">\"</span>example<span class=\"pl-pds\">\"</span></span> <span class=\"pl-e\">datatable</span>=<span class=\"pl-s\"><span\r\n            class=\"pl-pds\">\"</span>ng<span class=\"pl-pds\">\"</span></span> <span\r\n            class=\"pl-e\">dt-options</span>=<span class=\"pl-s\"><span class=\"pl-pds\">\"</span>dtOptions<span\r\n            class=\"pl-pds\">\"</span></span>&gt;\r\n\r\n&lt;<span class=\"pl-ent\">tr</span> <span class=\"pl-e\">ng-repeat</span>=<span class=\"pl-s\"><span\r\n            class=\"pl-pds\">\"</span>product in products.data<span class=\"pl-pds\">\"</span></span>&gt;&lt;/<span\r\n            class=\"pl-ent\">tr</span>&gt;\r\n\r\n&lt;/<span\r\n            class=\"pl-ent\">table</span>&gt;</pre>\r\n</div>\r\n\r\nanyone faced this issue before?  Thanks\r\n"},"comment":{"url":"https://api.github.com/repos/l-lin/angular-datatables/issues/comments/131767043","html_url":"https://github.com/l-lin/angular-datatables/issues/407#issuecomment-131767043","issue_url":"https://api.github.com/repos/l-lin/angular-datatables/issues/407","id":131767043,"user":{"login":"yantolee","id":3691680,"avatar_url":"https://avatars.githubusercontent.com/u/3691680?v=3","gravatar_id":"","url":"https://api.github.com/users/yantolee","html_url":"https://github.com/yantolee","followers_url":"https://api.github.com/users/yantolee/followers","following_url":"https://api.github.com/users/yantolee/following{/other_user}","gists_url":"https://api.github.com/users/yantolee/gists{/gist_id}","starred_url":"https://api.github.com/users/yantolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yantolee/subscriptions","organizations_url":"https://api.github.com/users/yantolee/orgs","repos_url":"https://api.github.com/users/yantolee/repos","events_url":"https://api.github.com/users/yantolee/events{/privacy}","received_events_url":"https://api.github.com/users/yantolee/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T10:14:46Z","updated_at":"2015-08-17T10:14:46Z","body":"Reopen for other issue"}}