Hello, i can’t figure out how to only connect once to Socket.io. In every page of my Ionic 2 project, i want to have function:
this.socket.on('chat message', (msg) => { ... });
but to do this, I need first to include:
this.socket = io(this.socketHost);
but this will create a new connection on every page…
Can someone here help me eith that?