title: no output from console.log inside socket.on()
body: <p>For a school assignment I have to modify the example chat app that's opened when a new Node.js workspace is created on cloud9.io. As I was looking through the code trying to figure out what's happening and what I need to change, I tried putting in some console.logs to see what is happening when, but for some reason most of the console.logs are never printed in the console when I run the app. So I am trying to understand this code and need some help!</p>
  
  <p>One example where console.log is not being printed:
  from the index.html</p>
  
  <pre><code>&lt;script&gt;
    function ChatController($scope) {
      var socket = io.connect();
  
      // ...
      // some more $scope.on function
  
      $scope.send = function send() {
        console.log('Sending message:', $scope.text); // this one gets printed
        socket.emit('message', $scope.text);
        $scope.text = '';
      };
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>from the server.js</p>
  
  <pre><code>io.on('connection', function (socket) {
      messages.forEach(function (data) {
        socket.emit('message', data);
      });
  
      // this is the code that i don't get. I thought if I send a message, 
      // the socket.emit('message', $scope.text) would call this 
      // socket.on('message' ...) to send the msg, but the text in 
      // console.log is never printed in the console
      socket.on('message', function (msg) {
        console.log("sending a message?"); // does not get printed
  
        var text = String(msg || '');
  
        if (!text)
          return;
  
        socket.get('name', function (err, name) {
          var data = {
            name: name,
            text: text
          };
  
          broadcast('message', data);
          messages.push(data);
        });
      });
    });
  </code></pre>
  
  <p>So yea, if you guys could guide me through this a little bit, that would be great! 
  Thanks!</p>