Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 使用NodeJS和Angular的XMPP聊天_Angularjs_Node.js_Xmpp - Fatal编程技术网

Angularjs 使用NodeJS和Angular的XMPP聊天

Angularjs 使用NodeJS和Angular的XMPP聊天,angularjs,node.js,xmpp,Angularjs,Node.js,Xmpp,此代码从XMPP服务器获取消息并将其记录到控制台: connection.on('online', function(data) { connection.on('stanza', function(stanza) { var body = stanza.getChild('body'); var message = body.getText(); console.log('with out socket: ', message);

此代码从XMPP服务器获取消息并将其记录到控制台:

connection.on('online', function(data) {

    connection.on('stanza', function(stanza) {
        var body = stanza.getChild('body');
        var message = body.getText();

        console.log('with out socket: ', message);

    });
});
这将在控制台中显示消息,但是如何发送此消息以在HTML页面上显示


我使用Angular JS。

我自己解决了这个问题。我使用socket.io读取我的消息,因此我可以在html页面上获取这些消息。我自己解决了这个问题。我使用socket.io读取我的消息,因此我可以在html页面上获取这些消息