Home iFrame in AngularJS, won't persist through navigation to other tab -- always reloads
Reply: 0

iFrame in AngularJS, won't persist through navigation to other tab -- always reloads

BM0127
1#
BM0127 Published in 2017-12-08 00:09:59Z

I have an iframe within an AngularJS application. The application itself is made up of several partial html pages. The iframe lives on one of these pages. When you navigate to the tab that the iframe lives on, it loads just fine, and we are passing data back and forth between Angular and the iframe. However if we navigate to a different tab, then navigate back to the iframe tab, the iframe content reloads. I want this iframe content to stick around if the user navigates to a different tab. Is this possible?

I've done a fair amount of Googling on this type of integration already, and have tried a few things. I now am using ng-src to define the iframe html:

<iframe ng-src="{{myIframe}}" id="myIframeId"></iframe>

And I use sce in the Angular code to trust this content:

$scope.myIframe= $sce.trustAsResourceUrl("./iframeContent.html");

This hasn't helped in terms of allowing my iframe to persist after page navigation. Any ideas are welcome, thanks in advance!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.268876 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO