I've been able to solve my own problem and updated my plunk with my 
solution (if anyone else runs into a similar issue).

The iframe directive I've added automatically binds the contents of the 
iframe to the current scope as long as the iframe is hosted from the same 
domain.

On Thursday, February 6, 2014 2:37:18 PM UTC+1, gwk wrote:
>
> Hi,
>
> I have an application I'm trying to angularize. In this app part of the 
> interface is in an iframe. This is so that the stylesheet for the content 
> in the iframe is isolated from the styles of the rest of the interface. I'm 
> trying to bind the data from the parent document in the iframe however I'm 
> running into some problems with this. Since the content in the iframe is 
> not part of the parent document even adding the ng-app directive to the 
> <html>-tag won't affect content in the iframe (it won't be bootstrapped by 
> angular). If I manually bootstrap the content of the iframe 
> (window.parent.angular.bootstrap(document.documentElement, ['myApp'])) will 
> create a separate application which means I can't just use services to 
> share data. I've sort of hacked around this issue by having the service 
> factory check for a cached value
>  on $window and $window.parent and return that if it exists. That leaves 
> me with one issue: the digest cycle. Because I now have essentially two 
> angular apps sharing the same variable for "communication" making a change 
> in one won't trigger the digest cycle in the other, see my plnkr.
>
> I'm hoping there is a better, more proper way to solve this, but if there 
> isn't, what would be the best strategy to trigger the digest cycle from the 
> other app (without each digest cycle continually triggering eachother)
>
>
> http://plnkr.co/edit/2p3BR0VbGlALefovmveO?p=preview
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to