Passing data between different angular apps

3,860 views
Skip to first unread message

tanner wilson

unread,
Mar 25, 2013, 3:12:33 PM3/25/13
to ang...@googlegroups.com
Hi,

I was wondering if there is any way to easily pass data between to angular apps. Kind of like how Android has Intents and explicit Intents to pass data between activities, and different applications.

Or is there a way that the 2 angular apps can both access the same data model. For instance app 1 updates the data model and changes a variable, Can app 2 view that change in the data model and update as well?

Thanks

Sander Elias

unread,
Mar 26, 2013, 4:50:08 AM3/26/13
to ang...@googlegroups.com
Hi Tanner,

Sure, there are lots of way's do do this. Are you looking for a client-side solution, or a server-side one? Are your apps on the same domain? If so, localstorage is your friend, as long as you can keep the the stuff really small. If not, it becomes a bit more complex, and takes a bit more planning. If you want a more specific answer, please give us more details on what you want to do.

Regards
Sander Elias

Nils Kilden-Pedersen

unread,
Mar 26, 2013, 8:21:21 AM3/26/13
to ang...@googlegroups.com
On Mon, Mar 25, 2013 at 2:12 PM, tanner wilson <tanma...@gmail.com> wrote:
Hi,

I was wondering if there is any way to easily pass data between to angular apps. Kind of like how Android has Intents and explicit Intents to pass data between activities, and different applications.

Maybe look into the HTML5 messaging API?

http://dev.w3.org/html5/postmsg/

 

Or is there a way that the 2 angular apps can both access the same data model. For instance app 1 updates the data model and changes a variable, Can app 2 view that change in the data model and update as well?

Thanks

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Joseph Curtin

unread,
Mar 26, 2013, 9:09:30 AM3/26/13
to ang...@googlegroups.com
Tanner, when you solve this problem, I'd like to know what you did. I would tackle this from phone-gap via writing a plugin that you can then pass messages to. 

If you can assume that you have access to both the applications, then you could assume that both the apps can be actively monitoring a pipeline that you can pass messages over. 

Before you attempt this though, ask yourself, are you suffering from X,Y? 

Alternatively, you could create a remote messaging system. Where you send messages to a queue online and when the other application opens, all you have to do is sync to a local data-store from that queue. Then, use embedded-urls to pass tokens to apps that have the rights to those temporary queues. This feels a lot easier. 
--
-Joey Curtin
http://www.jbcurtin.com
@jbcurtin

tanner wilson

unread,
Mar 26, 2013, 10:32:12 AM3/26/13
to ang...@googlegroups.com
well in our particular case we have multiple angular apps and what we did was sent the rootscope of one app to a variable and pass that variable back to the previous app that needs to access the data from the first app. 

Austin

unread,
Mar 2, 2020, 9:41:45 AM3/2/20
to Angular and AngularJS discussion
Using localstorage could be a security risk, right? Isn't there any other way that we achieve sharing of data between 2 unique angular applications?

Sander Elias

unread,
Mar 2, 2020, 12:14:23 PM3/2/20
to Angular and AngularJS discussion
Hi Austin,

If you are on version 9 or later, you can use a shared service. Angular 9 provides a way to share an service between angular 9+ apps on the same page

Regards
Sander

Joel Ransom

unread,
Mar 3, 2020, 12:26:50 AM3/3/20
to Angular and AngularJS discussion
At the risk of stating the obvious...seems like you want them to talk “to each other” instead of to a common api. What’s wrong with just letting them update When the data changes?
In my defense you didn’t describe your reasons for wanting to do this. 😀

Austin

unread,
Mar 3, 2020, 4:30:58 AM3/3/20
to Angular and AngularJS discussion
What about data sharing between versions of angular 1(AngularJS) and angular 8 .....and yes domain is the same. So currently I am using localstorage to share data between the two versions but that's not secure

Austin Paul

unread,
Mar 3, 2020, 6:40:51 AM3/3/20
to ang...@googlegroups.com
The application I'm working on was setup in AngularJS but now the requirement is that newer add on features have to be developed using latest Angular framework. So certain sets of data needs to be shared across the 2 versions without any api intervention.

On Tue, 3 Mar, 2020, 10:57 AM Joel Ransom, <joelr...@gmail.com> wrote:
At the risk of stating the obvious...seems like you want them to talk “to each other” instead of to a common api. What’s wrong with just letting them update When the data changes?
In my defense you didn’t describe your reasons for wanting to do this. 😀

--
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+u...@googlegroups.com.

Manjari Singh

unread,
Mar 3, 2020, 8:52:54 AM3/3/20
to ang...@googlegroups.com
One way is you can use the url, if it is hosted that way and then use response 

--
Sent from Gmail Mobile

AKOREDE FODILU OLAWALE

unread,
Aug 12, 2020, 12:30:26 AM8/12/20
to Angular and AngularJS discussion
Tanma please give me more info about how you did it. I want to implement something of sort
Reply all
Reply to author
Forward
0 new messages