-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
40 lines (36 loc) · 933 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
33
34
35
36
37
38
39
40
angular.module('movies', [
/**
* Dependencies must be injected in specific order:
* 1) AngularJS dependencies
* 2) Common Services, Directives, Filters and Utilities
* 3) App Layout component (e.g. Layout or Frame)
*/
// AngularJS dependencies
'ui.router',
'ui.router.state.events',
'ngCookies',
'mgcrea.ngStrap',
'star-rating',
'btford.socket-io',
// Common/shared code
'app.common',
'app.layout',
'app.dashboard',
'app.login',
'app.signup'
])
.factory('socket', function (socketFactory,CONFIG) {
return socketFactory({
ioSocket: io(CONFIG.BASE_URL)
});
})
.run(runBlock);
runBlock.$inject = ['$state','ROUTE_INFO','loginService'];
function runBlock($state,ROUTE_INFO,loginService) {
if(loginService.isAuthenticated()){
$state.go(ROUTE_INFO.DASHBOARD.STATE);
}
else {
$state.go(ROUTE_INFO.LOGIN.STATE);
}
}