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?
Asked
Active
Viewed 1,532 times
2 Answers
1
you should have two departments ready to achieve this :-
- you should have web socket server api implemeted which will send the notification to the subscriber in application.
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

Aditya Vashishtha
- 189
- 1
- 16
0
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

Abdalhadi Obaid
- 11
- 1
-
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Jeroen Heier Jan 14 '20 at 19:58
-
But I am using django on the backend. Does django have support for web sockets? – Nebex Elias Jan 15 '20 at 05:32