Skip to content

Instantly share code, notes, and snippets.

@teddyzeenny
Created May 20, 2014 17:32
Show Gist options
  • Save teddyzeenny/fa88c83fb5ad997cfe9d to your computer and use it in GitHub Desktop.
Save teddyzeenny/fa88c83fb5ad997cfe9d to your computer and use it in GitHub Desktop.
Socket service
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