Permalink
Browse files

Fix loadingService location

  • Loading branch information...
1 parent 19b6e6b commit dea82e654e975693ec677b7200c1abdae6874951 @rferro committed Oct 20, 2013
Showing with 18 additions and 18 deletions.
  1. +18 −0 src/public/js/app/index.coffee
  2. +0 −18 src/public/js/app/services.coffee
@@ -28,4 +28,22 @@ define ['angular'], (angular) ->
]
)
+ app.config(
+ [
+ '$httpProvider'
+ ($httpProvider) ->
+ numLoadings = 0
+ loadingScreen = $('<div class="serviceLoading"><div class="dot"></div></div>').hide().appendTo $('body')
+
+ $httpProvider.responseInterceptors.push ->
+ (promise) ->
+ numLoadings++
+ loadingScreen.fadeIn('fast')
+ hide = (r) ->
+ loadingScreen.fadeOut('fast') unless --numLoadings
+ r
+ promise.then hide, hide
+ ]
+ )
+
angular.bootstrap document, ['app']
@@ -2,24 +2,6 @@
define ['angular'], (angular) ->
app = angular.module 'app.services', []
- app.config(
- [
- '$httpProvider'
- ($httpProvider) ->
- numLoadings = 0
- loadingScreen = $('<div class="serviceLoading"><div class="dot"></div></div>').hide().appendTo $('body')
-
- $httpProvider.responseInterceptors.push ->
- (promise) ->
- numLoadings++
- loadingScreen.fadeIn('fast')
- hide = (r) ->
- loadingScreen.fadeOut('fast') unless --numLoadings
- r
- promise.then hide, hide
- ]
- )
-
app.service 'socket', ['$rootScope', ($rootScope) ->
@getInstance = (host, details) ->
socket = io.connect host, details

0 comments on commit dea82e6

Please sign in to comment.