Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • 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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(