Guest User

Untitled

a guest
Oct 20th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. ERROR TypeError: $(...).DataTable is not a function
  2. at angular-datatables.directive.js:38
  3.  
  4. DataTableDirective.prototype.displayTable = function () {
  5. var _this = this;
  6. this.dtInstance = new Promise(function (resolve, reject) {
  7. Promise.resolve(_this.dtOptions).then(function (dtOptions) {
  8. // Using setTimeout as a "hack" to be "part" of NgZone
  9. setTimeout(function () {
  10. //Error in this line
  11. var dt = $(_this.el.nativeElement).DataTable(dtOptions);
  12. resolve(dt);
  13. });
  14. });
  15. });
  16. };
  17.  
  18. npm install jquery --save
  19. npm install datatables.net --save
  20. npm install datatables.net-dt --save
  21. npm install angular-datatables --save
  22. npm install @types/jquery --save-dev
  23. npm install @types/datatables.net --save-dev
Add Comment
Please, Sign In to add comment