文章詳情頁
angular.js - angularjs用websocket做聊天功能發(fā)送不出去消息
瀏覽:122日期:2024-03-15 15:19:44
問題描述
點(diǎn)擊發(fā)送按鈕觸發(fā),消息發(fā)不出去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));}
請(qǐng)問angularjs在用webSocket時(shí)應(yīng)該怎么用?
問題解答
回答1:直接看github上的資料,里面就有詳細(xì)說明的https://github.com/AngularCla...
標(biāo)簽:
web
相關(guān)文章:
1. python 利用subprocess庫調(diào)用mplayer時(shí)發(fā)生錯(cuò)誤2. python文檔怎么查看?3. python - Pycharm的Debug用不了4. javascript - 關(guān)于apply()與call()的問題5. datetime - Python如何獲取當(dāng)前時(shí)間6. javascript - nginx反向代理靜態(tài)資源403錯(cuò)誤?7. html - eclipse 標(biāo)簽錯(cuò)誤8. 請(qǐng)問PHPstudy中的數(shù)據(jù)庫如何創(chuàng)建索引9. 安全性測試 - nodejs中如何防m(xù)ySQL注入10. python - pycharm 自動(dòng)刪除行尾空格
排行榜

熱門標(biāo)簽