Created Angular factory for Socket.io and now Angular uses  to handle the data from the socket.