I have:
connect(id: string) {
console.log(id);
this.connection = this.api.connect(id);
this.connection.on('open', function () {
this.testConnect();
});
}
testConnect(){
}
Use an arrow function:
this.connection.on('open', () => {
this.testConnect();
});