This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| KK.factory('httploadingInterceptor',['$q','$rootScope', function ($q, $rootScope) { | |
| return function (promise) { | |
| $rootScope.loading = true; | |
| return promise.then(function (response) { | |
| // hide the spinner | |
| $rootScope.loading = false; | |
| return response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| KK.factory('TokenHandler', ['$cookieStore', function ($cookieStore) { | |
| var tokenHandler = {}; | |
| tokenHandler.setToken = function (newToken) { | |
| $cookieStore.put("X-Authorization-Token", newToken); | |
| console.log('set token ' + newToken); | |
| }; | |
| tokenHandler.getToken = function () { | |
| console.log('get cookie ' + $cookieStore.get("X-Authorization-Token")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| /** | |
| * @ngdoc overview | |
| * @name ngResource | |
| * @description | |
| */ | |
| /** | |
| * @ngdoc object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .factory('TokenHandler', function() { | |
| var tokenHandler = {}; | |
| var token = "none"; | |
| tokenHandler.set = function( newToken ) { | |
| token = newToken; | |
| }; | |
| tokenHandler.get = function() { | |
| return token; |