forked from britztopher/angular-material-side-menu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.routes.js
106 lines (88 loc) · 2.42 KB
/
app.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
(function () {
'use strict';
// Declare app level module which depends on filters, and services
angular.module('myMenuApp', [
'myMenuApp.controllers',
'ngAnimate',
'ui.router',
'ngMaterial',
'ngAria',
])
.config(function ($mdThemingProvider) {
$mdThemingProvider.theme('default')
.primaryPalette('light-blue', {
'default': '300'
})
.accentPalette('deep-orange', {
'default': '500'
});
})
.config(['$stateProvider', '$urlRouterProvider', '$logProvider',
function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise("/");
$stateProvider
.state('home', {
url: '/',
views: {
'@': {
templateUrl: 'views/home.view.html',
controller: 'HomeCtrl as vm'
}
}
})
.state('home.gettingstarted', {
url: '/gettingstarted',
views: {
'content@home': {
templateUrl: 'views/gettingstarted.view.html'
}
}
})
.state('home.beers', {
url: 'beers',
abstract: true
})
.state('home.beers.ipas', {
url: '/ipas',
views: {
'content@home': {
templateUrl: 'views/beers.ipas.view.html'
}
}
})
.state('home.beers.porters', {
url: '/porters',
views: {
'content@home': {
templateUrl: 'views/beers.porters.view.html'
}
}
})
.state('home.beers.wheat', {
url: '/porters',
views: {
'content@home': {
templateUrl: 'views/beers.wheat.view.html'
}
}
})
}])
//take all whitespace out of string
.filter('nospace', function () {
return function (value) {
return (!value) ? '' : value.replace(/ /g, '');
};
})
//replace uppercase to regular case
.filter('humanizeDoc', function () {
return function (doc) {
if (!doc) return;
if (doc.type === 'directive') {
return doc.name.replace(/([A-Z])/g, function ($1) {
return '-' + $1.toLowerCase();
});
}
return doc.label || doc.name;
};
});
})();