S
S
Saveli Tomak2018-03-20 20:52:17
JavaScript
Saveli Tomak, 2018-03-20 20:52:17

How to rerender an angular component?

Good day to all. Problems with the implementation of the chat.
On @aspnet/signalr + angular 5 client . In ChatService I pass a callback which is called by the OnNewMessage event , the callback essentially converts the data from the server into the required form and adds it to the messages array in the angular component . All messages are successfully added to the array, but the angular is in no hurry to draw them. They get to the page only after interacting with the GUI, whether it's another click on the "send" button (that is, all messages are drawn except the last one), changing the room or changing the value in the input.
Actually the question is the possibility of forced redrawing of the component in angular.
Thank you all in advance :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2018-03-20
@aresouji

Without a code - fortune telling on coffee grounds, IMHO. But it seems that the changes are not detected. Try detectChanges() from ChangeDetectorRef.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question