old_contents: /**
   * 
   * AngularJS Boilerplate
   * @description           Description
   * @author                Jozef Butko // www.jozefbutko.com/resume
   * @url                   www.jozefbutko.com
   * @version               1.1.0
   * @date                  March 2015
   * 
   */
  ;(function() {
  
  
    /**
     * Definition of the main app module and its dependencies
     */
    angular
      .module('boilerplate', [
        'ngRoute',
        'ngSanitize'
      ])
      .config(config);
  
    config.$inject = ['$routeProvider', '$locationProvider', '$httpProvider', '$compileProvider'];
      
  
    /**
     * Routing of whole app
     *
     * You can leave it here in the config section or take it out
     * into separate file
     * 
     */
    function config($routeProvider, $locationProvider, $httpProvider, $compileProvider) {
  
      $locationProvider.html5Mode(false);
  
      // routes
      $routeProvider
        .when('/', {
          templateUrl: 'views/home.html',
          controller: 'MainController',
          controllerAs: 'main'
        })
        .when('/contact', {
          templateUrl: 'views/contact.html',
          controller: 'MainController',
          controllerAs: 'main'
        })
        .when('/about', {
          templateUrl: 'views/about.html',
          controller: 'MainController',
          controllerAs: 'main'
        })
        .otherwise({
          redirectTo: '/'
        });
  
  
      $httpProvider.interceptors.push('authInterceptor');
  
    }
  
  
    /**
     * You can intercept any request or response inside authInterceptor
     * or handle what should happend on 40x, 50x errors
     * 
     */
    angular
      .module('boilerplate')
      .factory('authInterceptor', function($rootScope, $q, LocalStorage, $location) {
  
        return {
  
          // intercept every request
          request: function(config) {
            config.headers = config.headers || {};
            return config;
          },
  
          // Catch 404 errors and redirect everythink
          responseError: function(response) {
            if (response.status === 404) {
              $location.path('/');
              return $q.reject(response);
            } else {
              return $q.reject(response);
            }
          }
        };
      })
      .run(function($rootScope, $location) {
  
        // put here everything that you need to run on page start
  
      });
  
  
  })();
  
new_contents: /**
   * 
   * AngularJS Boilerplate
   * @description           Description
   * @author                Jozef Butko // www.jozefbutko.com/resume
   * @url                   www.jozefbutko.com
   * @version               1.1.0
   * @date                  March 2015
   * 
   */
  ;(function() {
  
  
    /**
     * Definition of the main app module and its dependencies
     */
    angular
      .module('boilerplate', [
        'ngRoute'
      ])
      .config(config);
  
    config.$inject = ['$routeProvider', '$locationProvider', '$httpProvider', '$compileProvider'];
      
  
    /**
     * App routing
     *
     * You can leave it here in the config section or take it out
     * into separate file
     * 
     */
    function config($routeProvider, $locationProvider, $httpProvider, $compileProvider) {
  
      $locationProvider.html5Mode(false);
  
      // routes
      $routeProvider
        .when('/', {
          templateUrl: 'views/home.html',
          controller: 'MainController',
          controllerAs: 'main'
        })
        .when('/contact', {
          templateUrl: 'views/contact.html',
          controller: 'MainController',
          controllerAs: 'main'
        })
        .when('/about', {
          templateUrl: 'views/about.html',
          controller: 'MainController',
          controllerAs: 'main'
        })
        .otherwise({
          redirectTo: '/'
        });
  
  
      $httpProvider.interceptors.push('authInterceptor');
  
    }
  
  
    /**
     * You can intercept any request or response inside authInterceptor
     * or handle what should happend on 40x, 50x errors
     * 
     */
    angular
      .module('boilerplate')
      .factory('authInterceptor', function($rootScope, $q, LocalStorage, $location) {
  
        return {
  
          // intercept every request
          request: function(config) {
            config.headers = config.headers || {};
            return config;
          },
  
          // Catch 404 errors
          responseError: function(response) {
            if (response.status === 404) {
              $location.path('/');
              return $q.reject(response);
            } else {
              return $q.reject(response);
            }
          }
        };
      })
      .run(function($rootScope, $location) {
  
        // put here everything that you need to run on page start
  
      });
  
  
  })();
  
subject: Update app.js