angular. module('catalog'). config(['$locationProvider', '$routeProvider','cfpLoadingBarProvider', function config($locationProvider, $routeProvider,cfpLoadingBarProvider) { cfpLoadingBarProvider.includeSpinner = false; cfpLoadingBarProvider.parentSelector = 'header'; $locationProvider.html5Mode(true); //var a = window.location.host.split('.')[0]; $routeProvider .when('/',{ template: ''}) .when('/catalog2', { redirectTo: '/catalog'}) .when('/catalog', { template: '' }) .when('/catalog/:slug', { template: '' }) //.when('/info', {template: ''}) .when('/:slug',{template: ''}) .otherwise({ redirectTo: '/'}); } ]). run(function($rootScope,$http,$routeParams,gettextCatalog) { $rootScope.$on('$stateChangeStart', function(event,toState,toParams,fromState,fromParams) { console.log('statechangestart'); }); $rootScope.lanEs = ""; $rootScope.lanEu = ""; $rootScope.loading = false; $rootScope.startLoading = function() { console.log('start'); } $rootScope.stopLoading = function() { console.log('stop'); } //gettextCatalog.setCurrentLanguage('eu_ES'); gettextCatalog.debug = true; /*$http.get('wp-json/anorgatarrak/v1/link/'+window.location.pathname).then(function(res) { data = res.data; console.log(data); jQuery('#lan_link_eus').attr('href',data[1][1]); jQuery('#lan_link_es').attr('href',data[0][1]); });*/ });