Currently, I am utilizing ng-table to showcase data fetched from an API call that I organize similarly to the example provided on the website.
However, unlike the example on the website which uses static information, I need to make a fresh API call each time. Without including the $
scope.$watch('groupby', function(value)
function, I can successfully display the table for the initial call.
angular.module('myApp.controllers', ['ngTable','ui.bootstrap','dialogs'])
.controller('HomeCtrl', function($scope,$log, $rootScope, $modal, TimeService, EventServiceAPI, $filter, ngTableParams) {
var datum = new Date().setHours(0,0,0,0);
$scope.datum = datum;
var timestamp = Math.round(new Date().getTime()/1000);
// Rest of the controller code...
UPDATE:
I have managed to display the data successfully; however, the groups are not being shown:
var datum = new Date().setHours(0,0,0,0);
$scope.datum = datum;
var timestamp = Math.round(new Date().getTime()/1000);
EventServiceAPI.query({start: timestamp, end: timestamp + 3*24*60*60}).$promise.then(function(data) { $scope.data = data; initlizeTable(); });
// Rest of the updated code snippet...