/**
 * 
 * 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

    });


})();

@@ -400,28 +400,8 @@
 ute'
-,%0A      'ngSanitize'
 %0A   
@@ -544,28 +544,19 @@
   * 
-R
+App r
 outing
- of whole app
 %0A   
@@ -1827,32 +1827,8 @@
 rors
- and redirect everythink
 %0A   

Update app.js