Angular callback scope.apply
.bind should've been used here instead of .apply

on: function(msg, callback) {
    socket.on(msg, $rootScope.$apply.bind($rootScope, callback.bind.apply(socket, arguments)));
},


But seeing how complicated the shortened "one-liner" becomes, expanded form was probably better:

on: function(msg, callback) {
    socket.on(msg, function(data){
        $rootScope.$apply(function(){
            callback(data);
        });
    });
},