// main app
var app = angular.module('app', [
'ui.router',
'ngCookies',
'app.auth',
'app.advert',
'app.encyclopedia',
'app.post'
]);
app.run(function ($rootScope) {
$rootScope.$on('$stateChangeStart',
function(event, toState, toParams){
event.preventDefault();
console.log(123);
})
});