Question
Angular using DataTables error while importing DataTables.Settings
I am trying to use DataTables with Angular to view some data in my application.
I installed DataTables by ng add angular-datatables
and imported the DataTablesModule
in the app.module.ts but when I tried to configure the table:
dtOptions: DataTables.Settings = {};
dtTrigger: Subject<any> = new Subject<any>();
it automatically imported this for me:
import DataTables from 'datatables.net';
and I got this error:
'DataTables' only refers to a type, but is being used as a namespace here.
I searched for the error in many places and was not able to find the solution.