Emberjs and Socket.io


I am trying to add some real-time functionality to the ember app using socket.io. But since the socket instance created by io.connect() resides outside of my App namespace, and since App.controllerName.doSomething() is no longer allowed, how can I access a controller and update it’s content? (Note: not using ember-data).


You can create your socket instance inside another controller:

App.SocketController = Ember.Controller.extend({
  needs: ['other'],
  init: function() {
    this.socket = io.connect(); //I don't remember the correct syntax
    this.socket.on('data', this.onData.bind(this);
  onData: function() {

App.OtherController = Ember.Controller.extend({
  doSomething: function() {