Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include an angular app in a div on an other domain, no iframe

I have an angular application which has all kinds of dependencies like modules and styles.

On the other hand, I have multiple websites where I want to include this application with all dependencies (Like you have in an iFrame). I want to include the app in a div (as if it's an iframe) but I it must be a div, no iFrame, so those other sites can choose their own style for the inline application.

That way I can let every site include the app when I add it to my CORS. Like:

<div ng-include="app_from_other_domain"></div>

With all the routing inside that div.

I don't know where to start from here after reading much documentation. Any help would be appreciated!

like image 359
Jason van der Zeeuw Avatar asked Jul 01 '15 09:07

Jason van der Zeeuw


1 Answers

Why not to wrap the app in its own module and create a directive to use it? Then just require that module in your other angular apps. Isn't that cleaner?

like image 154
stic Avatar answered Sep 29 '22 22:09

stic