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

35 lines
1.1 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>'})
.when('/:slug',{template: '<an-content></an-content>'})
.otherwise({ redirectTo: '/'});
2018-02-15 19:26:12 +01:00
}
]).
run(function($rootScope) {
2018-02-15 19:26:12 +01:00
$rootScope.$on('$stateChangeStart',
function(event,toState,toParams,fromState,fromParams) { console.log('statechangestart'); });
$rootScope.loading = false;
2018-02-15 19:26:12 +01:00
$rootScope.startLoading = function() {
console.log('start');
}
$rootScope.stopLoading = function() {
console.log('stop');
}
});