Hi
am using angular js and ajax datatable using but am declare the datatable inside script i got error in "Datatable not a function" error came
i declare all supporting script files. my code is
view file
Script file for


Thank you
Hi
am using angular js and ajax datatable using but am declare the datatable inside script i got error in "Datatable not a function" error came
i declare all supporting script files. my code is
view file
Script file for


Thank you
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mohammad HussainPosted Jul 31, 2023, 6:18 AM
Make sure you have included the DataTables library in your project. You can include it by adding the appropriate script reference in your HTML file. For example:
Load jQuery Before DataTables: DataTables requires jQuery to be loaded before it. Make sure that you load jQuery before including the DataTables library in your project.
Load AngularJS Before DataTables: If you are using AngularJS in your project, make sure to load AngularJS before including DataTables. Ensure that the order of script references in your HTML is correct.
Check for Conflicts: Ensure there are no conflicts with other libraries or scripts that might be affecting the DataTables initialization. Conflicts can arise if different versions of jQuery are loaded or if other scripts interfere with the DataTables plugin.
Use AngularJS Directives (Optional): Instead of using script-based initialization, consider using AngularJS directives that wrap DataTables. There are several AngularJS directives available that integrate DataTables functionality into AngularJS projects. These directives help manage the lifecycle of the DataTable and can prevent potential conflicts.
Wait for Document Ready: Make sure you are initializing the DataTables plugin after the document is ready. You can wrap your DataTable initialization code inside jQuery's
$(document).ready()function or AngularJS's equivalent directive.