-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
58 lines (49 loc) · 1.94 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
angular.module('app', ['ui.bootstrap','ui.utils','ui.router','ngAnimate','user','employees','demo','httpPostFix']);
angular.module('user', ['ui.bootstrap','ui.utils','ui.router','ngAnimate']); // <------ add user
angular.module('employees', ['ui.bootstrap','ui.utils','ui.router','ngAnimate']); // <------ add employees
angular.module('demo', ['ui.bootstrap','ui.utils','ui.router','ngAnimate']); // <------ add demo
angular.module('app').config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/home');
$stateProvider.state('employees-list', {
url: '/employees-list',
templateUrl: 'modules/employees/employees-list/employees-list.html'
});
$stateProvider.state('user-list', {
url: '/user-list',
templateUrl: 'modules/user/user-list/user-list.html'
});
$stateProvider.state('user-create', {
url: '/user-create',
templateUrl: 'modules/user/user-create/user-create.html'
});
$stateProvider.state('user-update', {
url: '/user-update',
templateUrl: 'modules/user/user-update/user-update.html'
});
$stateProvider.state('demo-list', {
url: '/demo-list',
templateUrl: 'modules/demo/demo-list/demo-list.html'
});
/* Add New States Above */
});
angular.module('app').run(function($rootScope) {
$rootScope.safeApply = function(fn) {
var phase = $rootScope.$$phase;
if (phase === '$apply' || phase === '$digest') {
if (fn && (typeof(fn) === 'function')) {
fn();
}
} else {
this.$apply(fn);
}
};
});
// http://thegreenpizza.github.io/2013/05/25/building-minification-safe-angular.js-applications/
angular.module('app').service('constantsService', [ function() {
var constantsService = {
apiGetEndpoint: function( ) {
return 'http://localhost:8888/Enterprise/app/api.php';
}
};
return constantsService;
}]);