我有一个angular2-webpack应用程序,想要实现stomp,sockjs-客户端,websocket。
在中添加了“sockjs”:"0.3.18","stompjs":"2.3.3" in package.json。
在服务中这样写时:
import * as SockJS from 'sockjs-client';
import { Client, Message, Stomp } from 'stompjs/lib/stomp.min';有一个错误:
can't find name "Client",
can't find name "Message",
can't find name "Stomp",发布于 2016-10-05 04:27:09
发布于 2018-11-25 14:32:39
也有一个专门版本的角https://github.com/stomp-js/ng2-stompjs (npm @stomp/ng2-stompjs)。
它与Webpack,Rollup,RxJS和其他较新的库/工具链很好地合作.
https://stackoverflow.com/questions/39864990
复制相似问题