Click the send button to trigger, the message cannot be sent
controller:
var ws = new WebSocket("ws://121.43.160.149:8890/ws/phone/message");
var chatMessage = {
messagetxt : $scope.mmm,
touserid : thisId
}
var sMsg = {
messageContext : chatMessage,
messageType : "friendChat"
}
console.log(sMsg);
ws.onopen = function(e){
ws.send(JSON.stringify(sMsg));
}
How should I use webSocket in angularjs?
为情所困2017-05-15 17:07:37
Just look at the information on github, it has detailed instructions
https://github.com/AngularCla...