'use strict';

/**
* @ngdoc overview
* @name announcementBoardApp
* @description
* # announcementBoardApp
*
* Main module of the application.
*/
angular
.module('announcementBoardApp', [
  'ngAnimate',
  'ngRoute',
  'ngMaterial',
  'ngMessages',
  'announcementBoardApp.UserController',
  'announcementBoardApp.UserService',
  'announcementBoardApp.AuthorizationController',
  'announcementBoardApp.AuthorizationService'
])
.config(function ($routeProvider) {
  $routeProvider
    .when('/', {
      templateUrl: 'views/signup.html',
      controller: 'SignupCtrl'
    })
    .otherwise({
      redirectTo: '/'
    });
});
@@ -142,16 +142,52 @@
 %0A*/%0A
+var currentRequests = %5B%5D;%0A%0Avar app = 
 angular
-%0A
 .mod
@@ -276,16 +276,37 @@
 sages',%0A
+  'angular-storage',%0A
   'annou
@@ -478,33 +478,1839 @@
 '%0A%5D)
-%0A.config(function ($route
+;%0A%0Aapp.run(%5B'$rootScope', function($rootScope) %7B%0A%0A  /**%0A   * Cancels pending requests%0A   */%0A  $rootScope.$on('$routeChangeSuccess', function() %7B%0A    angular.forEach(currentRequests, function(request) %7B%0A      request.resolve(); // cancel%0A    %7D);%0A    currentRequests = %5B%5D;%0A  %7D);%0A%0A%7D%5D);%0A%0Aapp.factory('authInterceptor', %5B'$q', '$rootScope', '$location', '$timeout', function($q, $rootScope, $location, $timeout) %7B%0A%0A  return%7B%0A      request: function(config) %7B%0A//          delete $rootScope.errorKey;%0A          var currentAuthorization = null;//Authorization.getCurrentAuthorization();%0A          var access_token = currentAuthorization ? currentAuthorization.token : null;%0A%0A          if (access_token) %7B%0A              config.headers.authorization = access_token;%0A          %7D%0A%0A        if(!/%5C.html/.test(config.url)) %7B%0A            var defer = $q.defer();%0A            currentRequests.push(defer);%0A            config.timeout = defer.promise;%0A        %7D%0A%0A          return config;%0A      %7D,%0A      responseError: function(errorResponse) %7B%0A        if (errorResponse.status === 401) %7B%0A//            $rootScope.error = 'global.server_errors.unauthorized';%0A            $timeout(function () %7B%0A                $location.path('/');%0A            %7D, 3000);%0A        %7D else if(errorResponse.status !== 0) %7B%0A//          $rootScope.showErrorMsg = true; // general error message%0A//          $timeout(function() %7B%0A//            $rootScope.showErrorMsg = false;%0A//          %7D, 10000);%0A        %7D%0A%0A        return $q.reject(errorResponse);%0A      %7D%0A  %7D;%0A%0A%7D%5D);%0A%0Aapp.factory('Scopes', function () %7B%0A    var mem = %7B%7D;%0A%0A    return %7B%0A        store: function (key, value) %7B%0A            mem%5Bkey%5D = value;%0A        %7D,%0A        get: function (key) %7B%0A            return mem%5Bkey%5D;%0A        %7D%0A    %7D;%0A%7D);%0A%0Aapp.config(%5B'$routeProvider', '$httpProvider', function ($routeProvider, $http
 Prov
@@ -2348,16 +2348,20 @@
 hen('/',
+%0A   
  %7B%0A     
@@ -2442,49 +2442,231 @@
    .
-otherwise(%7B%0A      redirectTo: '/'%0A    %7D);%0A%7D
+when('/announcement',%0A    %7B%0A      templateUrl: 'views/announcement.html',%0A      controller: 'AnnouncementCtrl'%0A    %7D)%0A    .otherwise(%7B%0A      redirectTo: '/'%0A    %7D);%0A%0A     $httpProvider.interceptors.push('authInterceptor');%0A%7D%5D
 );

Add in http interceptors to handle request and responseError, scopes factory