Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Angular Demo1 not working


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) {


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


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.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(