mercredi 3 mai 2017

Socket IO using functions in event listener

I'm using socket io in Angular 2 and I have a problem with:

this.socket.on('response_navbar', function (data) {
  console.log(data.entryTypeCollection);
  this.test123();
});

test123() {
   console.log('Test');
}

after event 'response_navbar' will come, console.log() is working, but when I try to call function this.test123(); I recieve error

enter image description here

Can anyone help me?




Aucun commentaire:

Enregistrer un commentaire