-1

I have an angular app with routing where different paths look like example.com/#/route1, example.com/#/route2, etc.

When using links within the same page, it does not cause a reload of the page. I intend to support multiple apps like this by allowing them to run inside an iframe while I handle the navigation.

Currently, I am changing the path in the iframe as follows using jquery:

<iframe src="http://example.com/#/route1">
<iframe src="http://example.com/#/route2">

But changing from one to the other causes the page inside the iframe to refresh.

Any ideas on how to achieve the routing without a reload? Thanks.

Edit: ex. if you enter one path in your browser and then enter the second one, the page does not reload. I would like to achieve this same functionality but instead of changing the path in the browser, changing it in the iframe.

Javier Carmona
  • 527
  • 1
  • 8
  • 22
  • 1
    What is the purpose of using `iframes` and not Angular templates? – azium Jun 01 '15 at 14:51
  • I'm not sure I get what you mean, you want to switch between URL's without a page reload? – Guinn Jun 01 '15 at 15:04
  • Yes, when you switch between those urls from the regular page it does not cause a page reload. Ex if you enter one path in your browser and then enter the second one, the page does not reload. I would like to achieve this same functionality but instead of changing the path in the browser, changing it in the iframe. – Javier Carmona Jun 01 '15 at 15:11
  • You might want to look here for an answer: http://stackoverflow.com/questions/16725811/multiple-angularjs-applications-driving-portlets – azium Jun 01 '15 at 15:21

1 Answers1

0

The default behavior of the iframe does not reload the page, it behaves just like the browser. I had a logic error in my code that made it refresh. Thanks again for all the comments.

Javier Carmona
  • 527
  • 1
  • 8
  • 22