From 5abd35d4c1bb6adc902775881347e7e5836bb6c8 Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Thu, 23 Jul 2020 10:43:37 +0300 Subject: [PATCH] refactor(agent): refactor pingService to es6 (#4093) related to #4071 --- app/agent/services/pingService.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/agent/services/pingService.js b/app/agent/services/pingService.js index cc3133f22..bd6380912 100644 --- a/app/agent/services/pingService.js +++ b/app/agent/services/pingService.js @@ -1,14 +1,11 @@ -angular.module('portainer.agent').service('AgentPingService', [ - 'AgentPing', - function AgentPingService(AgentPing) { - var service = {}; +import angular from 'angular'; - service.ping = ping; +angular.module('portainer.agent').service('AgentPingService', AgentPingService); - function ping() { - return AgentPing.ping().$promise; - } +function AgentPingService(AgentPing) { + return { ping }; - return service; - }, -]); + function ping() { + return AgentPing.ping().$promise; + } +}