-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample
31 lines (30 loc) · 1.14 KB
/
sample
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
'use strict';
angular.module('something', [
'deps'
])
.config(function($locationProvider) {
$locationProvider.html5Mode(true);
})
.config(function($provide) {
return $provide.decorator('$uiViewScroll', function($delegate, $window) {
return function(uiViewElement) {
//eventually do something more intelligent with the uiViewElement
return $window.scrollTo(0, 0);
};
});
}).run(function($injector, ngProgress) {
var $rootScope = $injector.get('$rootScope');
// Sets the height of the progressbar. Use any valid CSS value Eg '10px', '1em' or '1%'.
// ngProgress.height();
// Sets the color of the progressbar and it's shadow. Use any valid HTML color
// ngProgress.color();
$rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState) {
ngProgress.start();
});
$rootScope.$on('$stateChangeSuccess', function() {
ngProgress.complete();
});
$rootScope.$on('$stateChangeError', function() {
ngProgress.done();
});
});