socket.broadcast.to(roomId).emit('xxxxxx',data); not working on client side
<p>client side code:</p>

<pre><code>    var app = angular.module("msgApp", ['btford.socket-io']);
    app.factory('socket', function (socketFactory) {
         return socketFactory({
             prefix: '',
             ioSocket: io.connect('http://localhost:3000/messages')
         });

    });

    app.controller('mainCtrl',['$scope','socket',function($scope,socket){
        var room='asdf';
        socket.on('connect',function(){
            socket.emit('create',room);
        });

        socket.on('msg',function(data){
            console.log('received');
            $scope.msg=data;
        });

    }]);
</code></pre>

<p>server side code:</p>

<pre><code>    'use strict';
    var app = require('express')();
    var server = require('http').Server(app);
    var io = require('socket.io')(server);
server.listen(3000,err=&gt;{
if(!err){
    console.log('app on 3k');
}
});

io.of('/orders').on('connection',(socket)=&gt;{
socket.on('create',function(roomNo){
    console.log(roomNo);
    socket.join(roomNo);
    var roomNo = 'asdf';
socket.broadcast.to(roomNo).emit('msg','hi all');
})

})
</code></pre>

<p>I tried this connection is established and 'create' event is also working but broadcast to is not working,client is not getting messages,Please help me whether problem is with angular or in socket io.</p>