summaryrefslogtreecommitdiff
path: root/www/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/app.js')
-rw-r--r--www/js/app.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/www/js/app.js b/www/js/app.js
index e1c724b5..2769e73d 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -17,6 +17,7 @@ angular.module('zmApp', [
// via img tags where this directive is added (I am using this in
// events and mionitor view to show a loader while the image is
// downloading from ZM
+
.directive('imageonload', function () {
return {
restrict: 'A',
@@ -46,9 +47,38 @@ angular.module('zmApp', [
//console.log("*** HTTP INTERCEPTOR CALLED ***");
return config;
}
+
+
};
})
+/* For future use - does not work with img src intercepts
+.factory ('httpAuthIntercept', function ($rootScope, $q)
+{
+ return {
+ requestError: function (response) {
+ console.log ("**** REJECT REQUEST: "+JSON.stringify(response));
+ return $q.reject(response);
+ },
+
+ responseError: function (response) {
+ console.log ("**** REJECT RESPONSE: "+JSON.stringify(response));
+ return $q.reject(response);
+ },
+ response: function (response)
+ {
+ console.log("*******RESPONSE with status: "+response.status+"****************");
+ if (response.status == 500)
+ {
+ console.log ("**** RESPONSE: "+JSON.stringify(response));
+ }
+ return (response);
+ }
+ };
+})
+*/
+
+
.run(function ($ionicPlatform, $ionicPopup, $rootScope, $state, ZMDataModel, $cordovaSplashscreen) {
ZMDataModel.init();
@@ -145,6 +175,8 @@ angular.module('zmApp', [
.config(function ($stateProvider, $urlRouterProvider, $httpProvider) {
$httpProvider.interceptors.push('timeoutHttpIntercept');
+ //$httpProvider.interceptors.push('httpAuthIntercept');
+
$stateProvider
.state('login', {