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?

4
  • 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... Commented Sep 28, 2013 at 7: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 Commented Sep 28, 2013 at 8: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. Commented Sep 28, 2013 at 23:12
  • possible duplicate of Angular - append html through different frames with one module per frame Commented Dec 22, 2014 at 12:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.