socialforge/public/javascripts/wechat/app.js

28 lines
836 B
JavaScript
Raw Normal View History

2016-06-12 13:40:14 +08:00
var app = angular.module('wechat', ['ngRoute']);
2016-06-17 18:18:03 +08:00
app.constant('config', {
rootPath: '/assets/wechat/',
rootUrl: '/',
apiUrl: '/api/v1/'
});
2016-06-17 18:18:03 +08:00
2016-06-20 15:21:13 +08:00
app.run(['$rootScope', 'auth', '$location', '$routeParams', function($rootScope, auth, $location, $routeParams){
$rootScope.$on('$routeChangeError', function(event, next, current){
if(next && next.templateUrl){
if(!next.templateUrl.endsWith("login.html") && !next.templateUrl.endsWith("reg.html")){
$location.path("/login");
}
}
});
$rootScope.$on('$routeChangeStart', function(event, next, current){
2016-06-20 15:21:13 +08:00
console.log($routeParams);
if(next && next.templateUrl){
if(!next.templateUrl.endsWith("login.html") && !next.templateUrl.endsWith("reg.html")){
}
}
});
}
]);