Por favor me ayudan a corregir este error "aDataSort" en datatables con Angular 8.
core.js:6014 ERROR TypeError: Cannot read property 'aDataSort' of undefined
at _fnSortFlatten (jquery.dataTables.js:5928)
at _fnSortingClasses (jquery.dataTables.js:6266)
at loadedInit (jquery.dataTables.js:1208)
at HTMLTableElement.<anonymous> (jquery.dataTables.js:1306)
at Function.each (jquery.js:381)
at jQuery.fn.init.each (jquery.js:203)
at jQuery.fn.init.DataTable [as dataTable] (jquery.dataTables.js:869)
at jQuery.fn.init.$.fn.DataTable (jquery.dataTables.js:15210)
at angular-datatables.directive.js:51
at ZoneDelegate.invokeTask (zone-evergreen.js:391)
Me parece que la tabla en el html requiere que la tabla tenga < thead> < tbody>. Pero los estoy ocultando con un "if" cuando la tabla no tiene ningún registro.
<div *ngIf="programaciones?.length==0" class="alert alert-info">
There is no record in the database!
</div>
<div class="table-responsive" >
<table datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger" class="row-border hover">
<thead *ngIf="programaciones?.length>0">
<tr >
<th>Id</th>
<th>Consultorio</th>
<th>Usuario</th>
<th>Fecha</th>
<th>Hora</th>
<th>Num. Turno</th>
<th>Editar</th>
<th>Eliminar</th>
</tr>
</thead>
<tbody >
<tr *ngFor="let programacion of programaciones" >
<td>{{programacion.pro_codigo}}</td>
<td>{{programacion.consultorio.con_nombre}}</td>
¿Cómo puedo corregir este error o hay alguna otra forma de ocultar la tabla cuando no hay registros?