{"size": 1289, "ext": "js", "max_stars_repo_path": "web/app/app.js", "max_stars_repo_name": "WengerK/Anagram-Hero", "max_stars_repo_stars_event_min_datetime": "2016-03-19T16:58:16.000Z", "max_stars_repo_stars_event_max_datetime": "2016-03-19T16:58:16.000Z", "max_issues_repo_path": "web/app/app.js", "max_issues_repo_name": "WengerK/Anagram-Hero", "max_issues_repo_issues_event_min_datetime": "2016-03-19T15:53:14.000Z", "max_issues_repo_issues_event_max_datetime": "2016-03-19T15:53:14.000Z", "max_forks_repo_path": "web/app/app.js", "max_forks_repo_name": "Sudei/Anagram-Hero", "max_forks_repo_forks_event_min_datetime": "2018-08-15T00:30:13.000Z", "max_forks_repo_forks_event_max_datetime": "2018-08-15T00:30:13.000Z"}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 26.306122449, "max_line_length": 133, "alphanum_fraction": 0.6501163693}
'use strict';

// Declare app level module which depends on views, and components
angular.module('anagram_hero', [
    'ngRoute',
    'ngCookies',

// Translations

// Modules Layout
'anagram_hero.footer',

// Modules Pages
'anagram_hero.api',
'anagram_hero.home',
'anagram_hero.authentication',
'anagram_hero.authentication.services',
'anagram_hero.game'
])

.config(['$routeProvider', function($routeProvider) {
    $routeProvider.otherwise({redirectTo: '/home'});
}])

.controller('AppCtrl', ['$scope', '$location', /*'$state', 'stateParams',*/ function( $scope, $location/*, $state, $stateParams*/ ) {

}])


.run(['$location', '$rootScope', 'AuthService', function($location, $rootScope, AuthService) {
    $rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
        if (current.hasOwnProperty('$$route')) {
            $rootScope.title = current.$$route.title + ' | Anagram Hero';
            $rootScope.description = current.$$route.description;
        }
    });

    $rootScope.$on('$routeChangeStart', function (event, next) {
        if(next.authenticated && !AuthService.isLoggedin()){
            $location.path("/login");
        }
    });

}]);

if ("ontouchstart" in document.documentElement) {
    document.documentElement.className += " touch";
}
