如何解决如何修复 ngOnInit 中未定义的可观察订阅返回
WebSocket.cpp D WebSocket thread start,helper instance: 0xc87ca8a0
D scheme: ws,host: 192.168.1.87,port: 7654
D NOTICE: Creating Vhost 'default' port -1,1 protocols,IPv6 on
D NOTICE: created client ssl context for default
D NOTICE: lws_client_connect_2: 0xc867b880: address 192.168.1.87
D NOTICE: uplevelling AF_INET to AF_INET6
D WebSocket (0xce47b900) Unhandled websocket event: 32
D WebSocket (0xce47b900) Unhandled websocket event: 29
jswrapper D JS: Created Camera: Profiler_Camera 1080x2160
WebSocket.cpp D NOTICE: lws_client_connect_2: 0xc867b880: address 192.168.1.87
D NOTICE: uplevelling AF_INET to AF_INET6
D WebSocket (0xce47b900) Unhandled websocket event: 24
D WARN: lws_client_handshake: got bad HTTP response '426 Upgrade Required'
D WebSocket (0xce47b900) onConnectionError,state: 0 ...
D WebSocket (0xce47b900) onConnectionClosed,state: 2 ...
D onConnectionClosed,WebSocket (0xce47b900) is closing by server.
D WebSocket (0xce47b900) onConnectionClosed DONE!
D WebSocket (0xce47b900) Unhandled websocket event: 50
D WebSocket (0xce47b900) Unhandled websocket event: 45
D WebSocket (0xce47b900) Unhandled websocket event: 33
D WebSocket (0xce47b900) onConnectionClosed,state: 3 ...
jswrapper D JS: onerror: undefined
Then I tried some other android devices and got the same error above.
I don't know what went wrong here,any advice will be appreciated,thanks :)
我试图在 @Select(AppState.getModuleData('rooms','collections')) rooms$: Observable<Array<any>>;
roomLists$ = new BehaviorSubject([]);
ngOnInit() {
this.rooms$.subscribe(x => { console.log(x)});
}
中调用 observable tasks$
但它返回未定义的值我也尝试在 OnInit
中应用但仍未定义。
因为我试图做的是转移 ngAfterViewInit()
中的 data rooms$
但是当我尝试 roomsLists$
和 subscribe
时它返回 console
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。