Usually when we use this, it refers to the class.
But in this case, this is dataChannel, how can I let this refers to VideoService again? Thanks
export class VideoService {
dataChannel:any;
setupPeerConnection() {
this.dataChannel.onopen = this.dataChannelStateChanged;
}
dataChannelStateChanged() {
// here this = dataChannel, how can I let this = VideoService
console.log(this);
}
}