You can read the local storage in one tab with code like this:

   this.scale = JSON.parse(localStorage.getItem('myScale'));

and save data in a tab with code like this:

   localStorage.setItem('myScale', JSON.stringify(this.scale));

These types of calls can be made in any component in your application.

If you have two components visible at the same time and want to share data 
between them, see this excellent tutorial:

https://angularfirebase.com/lessons/sharing-data-between-angular-components-four-methods/

HTH

Harry



On Friday, March 15, 2019 at 11:03:07 AM UTC-7, NANA DARKO wrote:
>
> How can I share session storage or local storage data between tabs in 
> angular?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to