-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
32 lines (29 loc) · 849 Bytes
/
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
var app = angular.module('trains', [
'ui.bootstrap'
,'ui.utils'
,'ui.router'
,'ngAnimate'
,'game'
,'home'
]);
angular.module('trains').config(function($stateProvider, $urlRouterProvider) {
/* Add New States Above */
$urlRouterProvider.otherwise('/home');
});
angular.module('trains')
.run(function($rootScope, $stateParams, $state) {
$rootScope.safeApply = function(fn) {
var phase = $rootScope.$$phase;
if (phase === '$apply' || phase === '$digest') {
if (fn && (typeof(fn) === 'function')) {
fn();
}
} else {
this.$apply(fn);
}
};
$rootScope.stateName = $state.current.name;
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
})
;