text: (function () {
  
    angular.module('meanApp', ['ngRoute']);
  
    function config ($routeProvider, $locationProvider) {
      $routeProvider
        .when('/', {
         redirectTo:"/login"
        })
        .when('/register', {
          templateUrl: '/auth/register/register.view.html',
          controller: 'registerCtrl',
          controllerAs: 'vm'
        })
        .when('/login', {
          templateUrl: '/auth/login/login.view.html',
          controller: 'loginCtrl',
          controllerAs: 'vm'
        })
        .when('/profile', {
          templateUrl: '/profile/profile.view.html',
          controller: 'profileCtrl',
          controllerAs: 'vm'
        })
        .otherwise({redirectTo: '/'});
  
      // use the HTML5 History API
      $locationProvider.html5Mode(true);
    }
  
    function run($rootScope, $location, authentication) {
      $rootScope.$on('$routeChangeStart', function(event, nextRoute, currentRoute) {
        if ($location.path() === '/profile' && !authentication.isLoggedIn()) {
          $location.path('/');
        }
      });
    }
    
    angular
      .module('meanApp')
      .config(['$routeProvider', '$locationProvider', config])
      .run(['$rootScope', '$location', 'authentication', run]);
  
  })();