blob: 4146f19a374af722be4987fd6079bc5dd018ea74 [file] [log] [blame]
Matteo Scandolo8942e042015-12-16 14:41:21 -08001'use strict';
2
3angular.module('autoscaling')
4.service('Autoscaling', function($http, $interval, $rootScope){
5
6 const pollingFrequency = 1;
7 var pollinginterval;
8
9 this.getAutoscalingData = () => {
10 pollinginterval = $interval(() => {
11 $http.get('/autoscaledata')
12 .then((res) => {
13 $rootScope.$emit('autoscaling.update', res.data);
14 });
15 }, pollingFrequency * 1000)
16 };
17});