Created
May 20, 2014 17:32
-
-
Save teddyzeenny/fa88c83fb5ad997cfe9d to your computer and use it in GitHub Desktop.
Socket service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SocketService = Ember.Object.extend({ | |
socket: null, | |
connect: function() { | |
// code to connect and set the socket | |
} | |
}); | |
App.initializer({ | |
name: 'socket', | |
initialize: function(container) { | |
container.register('service:socket', SocketService); | |
container.injection('controller', 'socket', 'service:socket'); | |
container.injection('route', 'socket', 'service:socket'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment