Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ERROR TypeError: $(...).DataTable is not a function
- at angular-datatables.directive.js:38
- DataTableDirective.prototype.displayTable = function () {
- var _this = this;
- this.dtInstance = new Promise(function (resolve, reject) {
- Promise.resolve(_this.dtOptions).then(function (dtOptions) {
- // Using setTimeout as a "hack" to be "part" of NgZone
- setTimeout(function () {
- //Error in this line
- var dt = $(_this.el.nativeElement).DataTable(dtOptions);
- resolve(dt);
- });
- });
- });
- };
- npm install jquery --save
- npm install datatables.net --save
- npm install datatables.net-dt --save
- npm install angular-datatables --save
- npm install @types/jquery --save-dev
- npm install @types/datatables.net --save-dev
Add Comment
Please, Sign In to add comment