小编Uni*_*orn的帖子

Angular 6-browser-crypto.js:3 Uncaught ReferenceError:未定义全局

我正在实现socketjs。但是我遇到了以下错误。

Angular 6套接字错误 以下是我正在使用的套接字和脚踏软件包。

import * as SockJS from 'sockjs-client';
import * as Stomp from 'stompjs/lib/stomp.js';
Run Code Online (Sandbox Code Playgroud)

提前致谢。

这是我的角度代码-

import * as Socket from 'socket.io-client';
import * as Stomp from 'stompjs/lib/stomp.js';

initializeWebSocketConnection2(){

let ws = new Socket(this.serverUrl);

this.stompClient = Stomp.over(ws);
let that = this;
this.stompClient.connect({}, function(frame) {


   that.stompClient.subscribe("/test", function(message){ 
        if(message.body) {
          console.log(message.body);
         window.location.reload(); 
        }
 });


   that.stompClient.subscribe("/operation", function(message){ 
        if(message.body) {
          console.log(message.body);
          window.location.reload();

        }
 });
Run Code Online (Sandbox Code Playgroud)

});

}

spring-boot angular angular6

4
推荐指数
2
解决办法
2827
查看次数

标签 统计

angular ×1

angular6 ×1

spring-boot ×1