Remove the socket listeners whenever the controller is destroyed.
You will need to bind the $destroy event like this:
function MyCtrl($scope, socket) {
socket.on('message', function(data) {
...
});
$scope.$on('$destroy', function (event) {
socket.removeAllListeners();
// or something like
// socket.removeListener(this);
});
};
For more information check the angularjs documentation.