anorgatarrak-wordpress-theme/app/catalog/catalog.config.js

47 lines
1.5 KiB
JavaScript
Raw Normal View History

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: '<an-home></an-home>'})
.when('/catalog2', { redirectTo: '/catalog'})
.when('/catalog', {
template: '<an-list></an-list>'
})
.when('/catalog/:slug', {
template: '<an-detail></an-detail>'
})
//.when('/info', {template: '<an-info></an-info>'})
.when('/:slug',{template: '<an-content></an-content>'})
.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]);
});*/
});