-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.js
35 lines (32 loc) · 1.07 KB
/
app.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
angular.module('ualib', [
'ngRoute',
'<%=pkg.name%>.templates',
'ualib.ui',
'hours',
'oneSearch',
'ualib.staffdir'
])
.config(['$routeProvider', function($routeProvider, $location) {
/**
* Register Bento Box display route with ngRoute's $routeProvider
*/
$routeProvider
.when('/home', {
templateUrl: '../assets/js/_ualib-home.tpl.html'
})
.otherwise({
redirectTo: '/home'
});
$routeProvider
.when('/libraries/:lib', {
templateUrl: '../assets/js/_ualib-libraries.tpl.html'
});
}])
.run(['$routeParams', '$location', '$rootScope', function($routeParams, $location, $rootScope){
$rootScope.$on('$routeChangeSuccess', function(e, current, pre) {
$rootScope.appClass = $location.path().split('/')[1];
console.log('Current route name: ' + $location.path().split('/'));
// Get all URL parameter
console.log($routeParams);
});
}]);