0

I have a couple of AngularJS apps, each opening in a different window. The first app is in an iframe and the second is on our main server, i.e. for clarity.

In the iframe app, for certain features, the user has to login. In that situation, a signin button appears which when clicked opens a new browser window and points https:// to our main site's app. Once they signin, the signin page closes properly and the session is maintained.

How do I trigger an event in the iframe app to listen for this? I do have common/shared services, but have been unsuccessful at my attempts to wire this event up.

Update:

Although I have shared services between the apps, the are bound to the associated app's $rootScope. There is no binding between the apps.

Given this, is there a way in either AngularJS, Underscore, or jQuery/JS to capture an event in a separate browser window from another browser window?

julie-coderiver
  • 1,119
  • 4
  • 14
  • 16
  • Based on your explanation, it looks like your iframe app module should have the main app module as a requirement when you define the app using `angular.app` - have you done that? In such a case, the services will be shared across the app... – callmekatootie Sep 28 '13 at 07:18
  • I did not inject the main app. I'll give that a go in the morning and see if that solves the issue. Thank you – julie-coderiver Sep 28 '13 at 08:47
  • No, that didn't work either. I setup a promise in the AuthorizationService which is a shared service. Status is being shared properly upon refresh. But I want it to occur async. – julie-coderiver Sep 28 '13 at 23:12
  • possible duplicate of [Angular - append html through different frames with one module per frame](http://stackoverflow.com/questions/23871919/angular-append-html-through-different-frames-with-one-module-per-frame) – Paul Sweatte Dec 22 '14 at 12:45

0 Answers0