peerx.on('signal', function(data) { console.log("1"); console.log(JSON.stringify(data)); this.targetpeer = data; **this.initiatorOffer = JSON.stringify(data); // i have initialized there** console.log(this.initiatorOffer); } this._chatservice.clientconnected().subscribe(data => { **console.log(this.initiatorOffer);** // getting value }) peerx.on('signal', function(data) { this.ngZone.run(() => { console.log("1"); console.log(JSON.stringify(data)); this.targetpeer = data; this.initiatorOffer = JSON.stringify(data); // i have initialized there** console.log(this.initiatorOffer); }) })