I'm using AngularJS Datatables plugin and I want to sort the table by column. The problem is when I click on a thead cell, everything will disappear. I'll attach some code down below. I tried to look for topics on the same subject, but I couldn't find anything that would help me. What am I doing wrong?
<table datatable="" dt-options="vm.dtOptions" dt-column-defs="vm.dtColumnDefs" class="row-border hover">
<thead>
<tr>
<th>ID</th>
<th>Username</th>
<th>Created at</th>
<th>Role</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="user in users">
<td>{{user.id}}</td>
<td>{{user.username}}</td>
<td>{{user.created_at}}</td>
<td>{{user.role}}</td>
<td>
<i class="fa fa-2x fa-user" data-toggle="modal" data-target="#user-info" ng-click="vm.getUserById(user.id)"></i>
<i class="fa fa-2x fa-edit" data-toggle="modal" data-target="#user-edit"></i>
<i class="fa fa-2x fa-trash" data-toggle="modal" data-target="#user-delete"></i>
</td>
</tr>
</tbody>
</table>
Controller
app.controller('UsersController', function UsersController($scope, UserService, DTOptionsBuilder, DTColumnDefBuilder) {
var vm = this;
vm.getUserById = getUserById;
vm.dtOptions = DTOptionsBuilder;
vm.dtColumnDefs = DTColumnDefBuilder;
});