Ionic $state doesn't trigger socket emit?


#1

.controller(‘completed’, function($scope,$state,socket) {

socket.on('connect', function(data) {
      socket.emit('order', 'test');
});

});

not sure why I need to refresh then only can see the emit got executed. I use $state.go(‘order’) to come to this page.