Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Access variable value for all users in angular

I have this service variable

Service:

  Users:BehaviorSubject<Array<any>> = new BehaviorSubject([]);

updating these values in component

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

 this.Service.Users.next([...this.Service.Users.value, ID]);

fetching values like this

this.Service.Users.subscribe(x=>{

});

i want if this variable values is updated by any user it should reflect in all the users component like right now only one who has updated the value has the value other users opened in other browser don’t have the updated value.

Thanks

>Solution :

you should use socket programming in angular for this ,
this is not possible by rxjs observable.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading