After several attempts I have resorted to asking something that is possibly very identifiable by its error.
Implementing notifications with Pusher I have run into a problem. I can't assign the receiving information to my model in Vuejs. I currently have my code as follows:
var channel = pusher.subscribe('my-channel.' + this.notificationId);
channel.bind('postulation', function(data) {
console.log(data)
})
I can pass it without any problem to the console receiving the notification. But... if I want to assign to a model, like this:
var channel = pusher.subscribe('my-channel.' + this.notificationId);
channel.bind('postulation', function(data) {
console.log(data)
this.notifyCount ++
})
It doesn't work, in fact, if I try to print, someone console.log(this.notifyCount)
tells me undefined
why I can't assign information to my model?
It should be said that it only happens within channel.bind()
How do I solve it?