l-lin / angular-datatables

DataTables with Angular
https://l-lin.github.io/angular-datatables/
MIT License
1.57k stars 481 forks source link

Property '"dtOptions"' is incompatible with index signature #1762

Closed paulido closed 6 months ago

paulido commented 6 months ago

Error: node_modules/angular-datatables/src/angular-datatables.directive.d.ts:41:86 - error TS2344: Type '{ dtOptions: { alias: "dtOptions"; required: false; }; dtTrigger: { alias: "dtTrigger"; required: false; }; }' does not satisfy the constraint '{ [key: string]: string; }'. Property '"dtOptions"' is incompatible with index signature. Type '{ alias: "dtOptions"; required: false; }' is not assignable to type 'string'.

shanmukhateja commented 6 months ago

Hi,

Try setting the type of dtOptions as any.

tampambro commented 6 months ago

@paulido I have the same error. I am on angular 15. Type of ɵɵDirectiveDeclaration in this version of angular can accept only string. I think need upgrade angular higher than 15 version.

goraxan commented 2 months ago

For those who are facing the same problem, I got it working using the angular-datatables@15.0.2:

npm install jquery --save
npm install datatables.net --save
npm install datatables.net-dt --save
npm install angular-datatables@15 --save
npm install @types/datatables.net@1.10.21 --save-dev

It looks like the angular-datatables@17 is not compatible with angular@15 (it does work with angular@16)