angular.js - angularjs uses websocket for chat function but cannot send messages
仅有的幸福
仅有的幸福 2017-05-15 17:05:37
0
1
604

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?

仅有的幸福
仅有的幸福

reply all(1)
为情所困

Just look at the information on github, it has detailed instructions
https://github.com/AngularCla...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template