-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.js
85 lines (81 loc) · 2.71 KB
/
routes.js
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
84
85
angular
.module('app')
.config(['$stateProvider', '$urlRouterProvider', '$ocLazyLoadProvider', '$breadcrumbProvider', function($stateProvider, $urlRouterProvider, $ocLazyLoadProvider, $breadcrumbProvider) {
$urlRouterProvider.otherwise('/dashboard');
$ocLazyLoadProvider.config({
// Set to true if you want to see what and when is dynamically loaded
// debug: true
});
$breadcrumbProvider.setOptions({
prefixStateName: 'app.main',
includeAbstract: true,
templateUrl : 'views/common/breadcrumb.html'
// template: '<li class="breadcrumb-item" ng-repeat="step in steps" ng-class="{active: $last}" ng-switch="$last || !!step.abstract"><a ng-switch-when="false" href="{{step.ncyBreadcrumbLink}}">{{step.ncyBreadcrumbLabel}}</a><span ng-switch-when="true">{{step.ncyBreadcrumbLabel}}</span></li>'
});
$stateProvider
.state('app', {
abstract: true,
templateUrl: 'views/common/layouts/full.html',
//page title goes here
ncyBreadcrumb: {
label: 'Root',
skip: true
},
resolve: {
loadCSS: ['$ocLazyLoad', function($ocLazyLoad) {
// you can lazy load CSS files
return $ocLazyLoad.load([{
serie: true,
name: 'Font Awesome',
files: ['bower_components/fontawesome/css/font-awesome.min.css']
},{
serie: true,
name: 'Simple Line Icons',
files: ['css/simple-line-icons.css']
}]);
}],
loadPlugin: ['$ocLazyLoad', function ($ocLazyLoad) {
// you can lazy load files for an existing module
return $ocLazyLoad.load([{
serie: true,
name: 'chart.js',
files: [
'bower_components/chart.js/dist/Chart.min.js',
'bower_components/angular-chart.js/dist/angular-chart.min.js'
]
}]);
}],
}
})
.state('app.main', {
url: '/dashboard',
templateUrl: 'views/main.html',
//page title goes here
ncyBreadcrumb: {
label: 'Dashboard',
},
//page subtitle goes here
params: { subtitle: 'Welcome to ROOT powerfull Bootstrap & AngularJS UI Kit' },
resolve: {
loadPlugin: ['$ocLazyLoad', function ($ocLazyLoad) {
// you can lazy load files for an existing module
return $ocLazyLoad.load([
{
serie: true,
name: 'chart.js',
files: [
'bower_components/chart.js/dist/Chart.min.js',
'bower_components/angular-chart.js/dist/angular-chart.min.js'
]
},
]);
}],
loadMyCtrl: ['$ocLazyLoad', function($ocLazyLoad) {
// you can lazy load controllers
return $ocLazyLoad.load({
files: ['js/controllers/main.js']
});
}]
}
})
}]);