Hello,
I'm currently writing an application using Angular 2 and have it configured to use DataTables.net, DataTables.net-bs, and DataTables.net-select.
For the most part, everything looks and works great. With one exception, the pagination for the application shows up with as though no styling is applied.
I checked the source within the browser and the default classes and HTML structure is applied:
<div class="dataTables_paginate paging_full_numbers" id="myTable_paginate">
<a tabindex="0" class="paginate_button first disabled" id="myTable_first" aria-controls="myTable" data-dt-idx="0">First</a>
<a tabindex="0" class="paginate_button previous disabled" id="myTable_previous" aria-controls="myTable" data-dt-idx="1">Previous</a>
<span>
<a tabindex="0" class="paginate_button current" aria-controls="myTable" data-dt-idx="2">1</a>
<a tabindex="0" class="paginate_button " aria-controls="myTable" data-dt-idx="3">2</a>
<a tabindex="0" class="paginate_button " aria-controls="myTable" data-dt-idx="4">3</a>
<a tabindex="0" class="paginate_button " aria-controls="myTable" data-dt-idx="5">4</a>
<a tabindex="0" class="paginate_button " aria-controls="myTable" data-dt-idx="6">5</a>
<span class="ellipsis">…</span>
<a tabindex="0" class="paginate_button " aria-controls="myTable" data-dt-idx="7">580</a>
</span>
<a tabindex="0" class="paginate_button next" id="myTable_next" aria-controls="myTable" data-dt-idx="8">Next</a>
<a tabindex="0" class="paginate_button last" id="myTable_last" aria-controls="myTable" data-dt-idx="9">Last</a>
</div>
The functionality of the links work and the it just looks ugly on the display because I'm using the DataTables Bootstrap CSS and it is not outputting the appropriate HTML using an unordered list. I went into the debugger in the browser and the code for the DataTables.net-bs is being loaded. I added a bunch of break points to the JavaScript and the factory method is being called. However, it appears that it is never called again.
Here is the relevant code for my vendors.browser.ts
require('datatables.net')();
require('datatables.net-bs')();
require('datatables.net-select')();
require('file-saver');
I also have AMD turned off because I know that was an issue for some people. Here is the relevant code for the webpack.common.js file:
{
test: /datatables\.net.*/,
loader: 'imports?define=>false'
},
As an aside, the other plugin, Datatables.net-select, functions properly.
If I can't figure this out, I can use the styling included in DataTables.net-dt, but I would much rather get this working properly.
Does anyone have any potential ideas on what is going on?