stephenlb / angularjs-chat

AngularJS Chat - Enable chat messaging experiences in your iOS, Android and Web apps.
https://stephenlb.github.io/angularjs-chat/
MIT License
73 stars 64 forks source link

Failed to send the message by testing the tutorial #11

Open andrescefe opened 7 years ago

andrescefe commented 7 years ago

Hello, I have this error "TypeError: self.rooms[setup.to].publish is not a function" when sending the message I already have the keys in pubnub, what should I do to make it work? angular version 1.6.6

Bxggi3 commented 6 years ago

Having the Same Issue

venkateshmalgireddy commented 6 years ago

Change .publish to .message in the angular-chat.js module. That is the function which publish messages to server in the socketio.js module

srivassumit commented 6 years ago

To be more specific, open the \bower_components\angular-chat\angular-chat.js file. (or \node_modules\angular-chat\angular-chat.js if using npm)

In that file, go to line number 87, where it says return self.rooms[setup.to].publish({ change it to: return self.rooms[setup.to].message({

With this, I was able to get it to get rid of this error "TypeError: self.rooms[setup.to].publish is not a function"