I have one page that will be run for the whole day and I also need to refresh the data every 5 seconds. here is code=> private ngUnsubscribe = new Subject(); selectData(){ this.selectData$= interval(5000).pipe( takeUntil(this.ngUnsubscribe), startWith(0), switchMap(_ => forkJoin([ getAll1(), getAll2()])), multicast(() => new Subject()) ) as ConnectableObservable<any>; this.dataBinding(); this.selectData$.connect(); } dataBinding(){ this.selectData$ .pipe( takeUntil(this.ngUnsubscribe) ..

Read more

I am developing a simple live chat using Web Socket using flask_socketio with Angular on frontend. web-socket.service.ts openWebSocket(): void { this.webSocket = new WebSocket(‘ws://localhost:5000’); this.webSocket.onopen = (event) => { console.log(‘Opened connection: ‘, event); }; this.webSocket.onmessage = (event) => { const chatMessageDTO = JSON.parse(event.data); this.chatMessages.push(chatMessageDTO); }; this.webSocket.onclose = (event) => { console.log(‘Closed connection: ‘, event); }; ..

Read more

Trying to use the NGRX with angular 12 keep getting weird errors like below Cannot assign to read only property ‘status’ of object ‘[object Object]’ TypeError: Cannot assign to read only property ‘status’ of object ‘[object Object]’ TypeError: Cannot assign to read only property ‘status’ of object ‘[object Object]’ TypeError: Cannot add property 0, object ..

Read more