I am new in AngularJS. I am facing a problem, my data is not being displayed in data table. Can anyone help me with this?
my code
HTML code
<div class="content table-responsive table-full-width">
<table id="myTable" class="table table-striped table-hover" datatable="">
<thead>
<th>Account ID</th>
<th>Name</th>
<th>Email</th>
<th>Registered On</th>
<!--<th>Settings</th>-->
<th>Status</th>
</thead>
<tbody>
<tr ng-repeat="user in users">
<td style="text-align:left;">{{user.account}}</td>
<td style="text-align:left;">{{user.name}}</td>
<td style="text-align:left;">{{user.email}}</td>
<td style="text-align:left;" ng-model="dateVal">{{user.register}}</td>
<td style="text-align:left;">
<span class="label {{ user.status == 1 && 'label-success' || 'label-danger'}} " ng-click="updated(user.id)">
{{ user.status == 1 && 'Active' || 'Inactive'}}
</span>
</td>
<td>
<a href="index.html#/edit_userpermission?id={{user.id}}" class="fa fa-cog" data-toggle="modal" data-target="#myModal"></a>
</td>
</tr>
</tbody>
</table>
JS code
/* User Listing */
var url = UserService.url+'users.php?token='+localStorage.getItem("token");
$http.get(url).success( function(data)
{
$('#myTable').DataTable();
if(data.login != null ){
$location.path( "/logout" );
}
$scope.users = data;
});
When I click the sort option it displays "no data available in table"... Why do this happen? Waiting for a response. Thanks in advance
