I am trying to use the jquery DataTables in magento-2 frontend using the requirejs.
I can see the datables.min.js file in the net panel,
but somehow it give the following error.
My reuirejs-config.js
looks like this
var config = {
map: {
'*': {
dataTable: 'Ktpl_Slider/js/datatables.min'
}
}
};
And i am calling this function in a template file as follows
<script type="application/javascript">
requirejs(['jquery','dataTable'],function($){
$(document).ready(function(){
$('#list-table').DataTable();
});
});
</script>
I guess there is problem with the order of loading the js files. i tried with shim configuration but that did not work, maybe there was some mistake in the shim configuration