I'm getting ERROR TypeError: $(...).DataTable is not a function while using in angular 4.

Any suggestions for resolving this issue.
If you are importing jQuery as a local lib, in your *component.ts file, like:
import * as jquery from 'jquery'
remove that line and treat it as a global library:
declare var jquery: any;
or
declare var $: any;
or just add one of that two lines to src/typings.d.ts
Still I did not get datable(datatable is not a function) after adding
import * as $ from 'jquery';
Then I added below code also it's working now:
import 'datatables.net';
If you still did receive an error, try with the below also:
import 'datatables.net-bs4';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With