|
@@ -16,44 +16,60 @@ var luticate = angular.module('luticate', [
|
16
|
16
|
luticate.config(['$stateProvider', '$urlRouterProvider', '$httpProvider',
|
17
|
17
|
function($stateProvider, $urlRouterProvider, $httpProvider) {
|
18
|
18
|
|
|
19
|
+ $stateProvider.state('root', {
|
|
20
|
+ abstract: true,
|
|
21
|
+ template: '<div ui-view=""></div>',
|
|
22
|
+ resolve: ['luticateAuthUsers', function(luticateAuthUsers)
|
|
23
|
+ {
|
|
24
|
+ return luticateAuthUsers.loadUserData(null);
|
|
25
|
+ }]
|
|
26
|
+ });
|
|
27
|
+
|
19
|
28
|
$stateProvider.state('login',{
|
20
|
29
|
url:'/',
|
|
30
|
+ parent: 'root',
|
21
|
31
|
templateUrl:'views/login.html',
|
22
|
32
|
controller:'LoginController'
|
23
|
33
|
});
|
24
|
34
|
|
25
|
35
|
$stateProvider.state('home',{
|
26
|
36
|
url:'/home',
|
|
37
|
+ parent: 'root',
|
27
|
38
|
templateUrl:'views/home.html',
|
28
|
39
|
controller:'HomeController'
|
29
|
40
|
});
|
30
|
41
|
|
31
|
42
|
$stateProvider.state('users',{
|
32
|
43
|
url:'/users',
|
|
44
|
+ parent: 'root',
|
33
|
45
|
templateUrl:'views/users.html',
|
34
|
46
|
controller:'UsersController'
|
35
|
47
|
});
|
36
|
48
|
|
37
|
49
|
$stateProvider.state('groups',{
|
38
|
50
|
url:'/groups',
|
|
51
|
+ parent: 'root',
|
39
|
52
|
templateUrl:'views/groups.html',
|
40
|
53
|
controller:'GroupsController'
|
41
|
54
|
});
|
42
|
55
|
|
43
|
56
|
$stateProvider.state('permissions',{
|
44
|
57
|
url:'/permissions',
|
|
58
|
+ parent: 'root',
|
45
|
59
|
templateUrl:'views/permissions.html',
|
46
|
60
|
controller:'PermissionsController'
|
47
|
61
|
});
|
48
|
62
|
|
49
|
63
|
$stateProvider.state('settings',{
|
50
|
64
|
url:'/settings',
|
|
65
|
+ parent: 'root',
|
51
|
66
|
templateUrl:'views/settings.html',
|
52
|
67
|
controller:'SettingsController'
|
53
|
68
|
});
|
54
|
69
|
|
55
|
70
|
$stateProvider.state('test',{
|
56
|
71
|
url:'/test',
|
|
72
|
+ parent: 'root',
|
57
|
73
|
templateUrl:'views/test.html',
|
58
|
74
|
controller:'TestController'
|
59
|
75
|
});
|
|
@@ -83,8 +99,7 @@ luticate.config(['$stateProvider', '$urlRouterProvider', '$httpProvider',
|
83
|
99
|
|
84
|
100
|
}])
|
85
|
101
|
.run(['$rootScope', '$state', 'luticateAuthUsers',function ($rootScope, $state, luticateAuthUsers) {
|
86
|
|
- luticateAuthUsers.loadPermissions(null);
|
87
|
102
|
$rootScope.$on('$stateChangeError', function (e, curr, prev) {
|
88
|
|
- $state.go('login');
|
|
103
|
+ //$state.go('login');
|
89
|
104
|
});
|
90
|
105
|
}]);
|