diff options
author | Fulup Ar Foll <fulup@iot.bzh> | 2016-02-16 18:33:01 +0100 |
---|---|---|
committer | Fulup Ar Foll <fulup@iot.bzh> | 2016-02-16 18:33:01 +0100 |
commit | 3482263a53803b6e7662e67b39ed97bdd9fcef13 (patch) | |
tree | d38b96813bbfa7c4053d64e53aae382c32ab07fe /afm-client/app | |
parent | e638f2f05da0c8d49c27a4323e261b6f36447d2b (diff) |
Fixed BeforeUnload Binder Call in ProdMode
Diffstat (limited to 'afm-client/app')
-rw-r--r-- | afm-client/app/Frontend/etc/AppConfig.js | 6 | ||||
-rw-r--r-- | afm-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/afm-client/app/Frontend/etc/AppConfig.js b/afm-client/app/Frontend/etc/AppConfig.js index 1963203..e14dcef 100644 --- a/afm-client/app/Frontend/etc/AppConfig.js +++ b/afm-client/app/Frontend/etc/AppConfig.js @@ -32,10 +32,12 @@ }) // Factory is a singleton and share its context within all instances. - .factory('AppCall', function ($http, AppConfig) { + .factory('AppCall', function ($http, AppConfig, $log) { var myCalls = { get : function(plugin, action, query, callback) { - if (!query.token) query.token = AppConfig.session.token; // add token to provided query + if (!query.token) query.token = AppConfig.session.token; // add token to provided query + $log.log ('AppCall.get /api/' + plugin + '/' + action + '?' + query); + $log.log (callback); $http.get('/api/' + plugin + '/' + action , {params: query}).then (callback, callback); } diff --git a/afm-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js b/afm-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js index c4a086e..4d7aed6 100644 --- a/afm-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js +++ b/afm-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js @@ -34,14 +34,14 @@ // scope module is load statically before any route is cativated angular.module('TokenRefresh', ['AppConfig', 'ModalNotification']) - .directive ('tokenRefresh', function($window, $timeout, $location, Notification, AppConfig, AppCall) { + .directive ('tokenRefresh', function($log, $window, $timeout, $location, Notification, AppConfig, AppCall) { function mymethods(scope, elem, attrs) { scope.logged=undefined; // neither thu neither false $window.onbeforeunload = function () { - AppCall.get ("token", "reset", {/*query*/}, function () { - console.log("OPA Exit Requested"); + AppCall.get ("token", "reset", {/*query*/}, function () { + $log.log("OPA exit"); }); }; |