/
admin.ts
49 lines (38 loc) · 1.46 KB
/
admin.ts
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
///<reference path="../../../src/global.d.ts" />
namespace app.admin {
export const namespace = 'app.admin';
class AdminConfig {
static $inject = ['stateHelperServiceProvider'];
constructor(private stateHelperServiceProvider){
let state:global.IState = {
abstract: true,
url: '/admin',
views: {
'app@': { // Points to the ui-view in the index.html
templateUrl: 'templates/app/_layouts/admin.tpl.html',
controller: app.namespace + '.controller',
controllerAs: 'AppController',
},
'navigation@app.admin': { // Points to the ui-view="navigation" in admin.tpl.html
templateUrl: 'templates/app/admin/navigation/navigation.tpl.html',
controller: app.admin.navigation.namespace+'.controller',
controllerAs: 'AdminNavigationController',
}
},
data: {
loggedIn: true,
role: 'admin',
}
};
stateHelperServiceProvider.addState(namespace, state);
}
}
angular.module('app.admin', [
'app.admin.dashboard',
'app.admin.articles',
'app.admin.media',
'app.admin.users',
'app.admin.navigation',
])
.config(AdminConfig);
}