I am working with django-notification and I am trying to fetch and display the notifications on my angular app. So how should I fetch the data from the backend to make it real-time? Should I periodically fetch data using something like setTimeout? or is there a better way to do this in angular?
How to fetch and display real-time user notifications in angular?
1.8k Views Asked by Nebex Elias At
2
There are 2 best solutions below
2
On
I would like to suggest to read about firebase or nodejs socket, Bellow link could help https://firebase.google.com/docs/database/web/read-and-write
you should have two departments ready to achieve this :-
you can use WebSocketSubject rxjs special kind of subject which will let you consume the web socket API,you can read more about this subject to following link.
https://rxjs-dev.firebaseapp.com/api/webSocket/WebSocketSubject