index.route.js
2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
(function() {
'use strict';
angular
.module('angular')
.config(routeConfig);
function routeConfig($stateProvider, $urlRouterProvider) {
$stateProvider
.state('main', {
url: '',
templateUrl: 'app/main/main.html',
controller: 'MainController',
controllerAs: 'vm',
resolve: {
currentUser: function(AuthService) {
return AuthService.loginFromCookie();
}
}
})
.state('main.profile.cms', {
url: '^/myprofile/:profile/cms',
views: {
'mainBlockContent': {
templateUrl: 'app/cms/cms.html',
controller: 'CmsController',
controllerAs: 'vm'
}
}
})
.state('main.profile.settings', {
url: '^/myprofile/:profile'
})
.state('main.profile', {
url: '/:profile',
abstract: true,
views: {
'content': {
templateUrl: 'app/profile/profile.html',
controller: 'ProfileController',
controllerAs: 'vm'
}
}
})
.state('main.profile.home', {
url: '',
views: {
'mainBlockContent': {
controller: 'ProfileHomeController',
controllerAs: 'vm'
}
}
})
.state('main.profile.info', {
url: '^/profile/:profile',
views: {
'mainBlockContent': {
templateUrl: 'app/profile-info/profile-info.html',
controller: 'ProfileInfoController',
controllerAs: 'vm'
}
}
})
.state('main.profile.page', {
url: '/{page:any}',
views: {
'mainBlockContent': {
templateUrl: 'app/content-viewer/page.html',
controller: 'ContentViewerController',
controllerAs: 'vm'
},
'actions@main': {
templateUrl: 'app/content-viewer/navbar-actions.html',
controller: 'ContentViewerActionsController',
controllerAs: 'vm'
}
}
});
$urlRouterProvider.otherwise('/');
}
})();