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

47 lines
1.5 KiB
JavaScript
Raw Normal View History

angular.
module('catalog').
2018-02-15 19:26:12 +01:00
config(['$locationProvider', '$routeProvider','cfpLoadingBarProvider',
function config($locationProvider, $routeProvider,cfpLoadingBarProvider) {
cfpLoadingBarProvider.includeSpinner = false;
cfpLoadingBarProvider.parentSelector = 'header';
2017-11-09 19:40:49 +01:00
$locationProvider.html5Mode(true);
//var a = window.location.host.split('.')[0];
2018-02-15 19:26:12 +01:00
$routeProvider
2017-11-09 19:40:49 +01:00
.when('/',{ template: '<an-home></an-home>'})
2018-02-15 19:26:12 +01:00
.when('/catalog2', { redirectTo: '/catalog'})
2017-11-09 19:40:49 +01:00
.when('/catalog', {
template: '<an-list></an-list>'
2017-11-09 19:40:49 +01:00
})
.when('/catalog/:slug', {
template: '<an-detail></an-detail>'
2017-11-09 19:40:49 +01:00
})
//.when('/info', {template: '<an-info></an-info>'})
2017-11-09 19:40:49 +01:00
.when('/:slug',{template: '<an-content></an-content>'})
.otherwise({ redirectTo: '/'});
2018-02-15 19:26:12 +01:00
}
]).
run(function($rootScope,$http,$routeParams,gettextCatalog) {
2018-02-15 19:26:12 +01:00
$rootScope.$on('$stateChangeStart',
function(event,toState,toParams,fromState,fromParams) { console.log('statechangestart'); });
$rootScope.lanEs = "";
$rootScope.lanEu = "";
$rootScope.loading = false;
2018-02-15 19:26:12 +01:00
$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]);
});*/
});