I recently purchased metronics package and trying to use Angular Demo1. I ran following commands after installing:
npm cache clean --force
npm install --legacy-peer-deps
ng serve
However, it is giving following error about DataTables:
Error: node_modules/angular-datatables/src/angular-datatables.directive.d.ts:31:25 - error TS2503: Cannot find namespace 'DataTables'.
31 dtInstance: Promise<DataTables.Api>;
I imported the module in app.module.ts using import { DataTablesModule } from 'angular-datatables' and added the same inside @NgModule -> imports
Error: node_modules/angular-datatables/src/models/settings.d.ts:3:38 - error TS2503: Cannot find namespace 'DataTables'.
3 export interface ADTSettings extends DataTables.Settings {
some of the other errors:
src/app/pages/permission/permission-listing/permission-listing.component.ts:44:41 - error TS7006: Parameter 'callback' implicitly has an 'any' type.
44 ajax: (dataTablesParameters: any, callback) => {
Error: src/app/pages/permission/permission-listing/permission-listing.component.ts:56:63 - error TS7006: Parameter 'data' implicitly has an 'any' type.
56 title: 'Assigned To', data: null, render: function (data, type, row) {
Glad to hear it worked! Thank you for your solution, Dev. If you need further assistance, feel free to ask.
npm i @types/datatables.net@1.10.28 --legacy-peer-deps
function (data: any, type: any, row: any)
(dataTablesParameters: any, callback: any)
Thanks for your quick response, works great.