Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include angular 4 app inside iframe in another app?

How to include a angular app in a non-angular app by using a iframe? Must be able to use angular app through this iframe with all routing still working. Is it possible? or Am I thinking wrong? Feel free to correct me. Thanks in advance.

like image 450
Shine Avatar asked Oct 31 '18 16:10

Shine


1 Answers

iFrame is a complete DOM. As per MDN: Each embedded browsing context has its own session history and active document.

With that in mind, angular apps will work just fine inside an iFrame.

General syntax: <iframe src="url_to_your_angular_app"></iframe>

Read more: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe

like image 91
Aragorn Avatar answered Nov 15 '22 01:11

Aragorn