2016-07-26 23:08:18 +00:00
|
|
|
angular.module('events', [])
|
2017-12-06 11:04:02 +00:00
|
|
|
.controller('EventsController', ['$scope', 'Notifications', 'SystemService',
|
|
|
|
function ($scope, Notifications, SystemService) {
|
2017-01-24 01:28:40 +00:00
|
|
|
|
2017-06-20 11:00:32 +00:00
|
|
|
function initView() {
|
|
|
|
var from = moment().subtract(24, 'hour').unix();
|
|
|
|
var to = moment().unix();
|
2016-07-26 23:08:18 +00:00
|
|
|
|
2017-06-20 11:00:32 +00:00
|
|
|
SystemService.events(from, to)
|
|
|
|
.then(function success(data) {
|
|
|
|
$scope.events = data;
|
|
|
|
})
|
|
|
|
.catch(function error(err) {
|
|
|
|
Notifications.error('Failure', err, 'Unable to load events');
|
2016-07-26 23:08:18 +00:00
|
|
|
});
|
2017-06-20 11:00:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
initView();
|
2016-07-26 23:08:18 +00:00
|
|
|
}]);
|