Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can we load an external angular site inside another angular site?

Tags:

angularjs

Site1 and Site2 are built in angularjs. Whether do we have any concept in angularjs (except iframe) to load pages of Site2 inside a div of Site1 ? Incase if you have any examples, please share here. Thanks in advance.

update 1

Apart from the html content loaded from a external url (site2) to the source site (site1), there are lot of css and js files included in the site2 screens, whether that will also get loaded ?

like image 631
vignesh suryah Avatar asked Mar 15 '23 12:03

vignesh suryah


2 Answers

You can use

1) ngInclude Check documentation for usage

2) ng-bind-html, but you'll have to take care of ngSanitize. You have to put your html content in a special variable that is marked as trusted html. For this you have to use the $sce service.

Hope it helps

like image 93
akashrajkn Avatar answered Apr 24 '23 21:04

akashrajkn


No need to specific angular tags, you can directly use object tag like this:

<div> 
    <object type="text/html" data="http://validator.w3.org/" width="800px" height="600px">
    </object>
 </div>
like image 33
Salim Hamidi Avatar answered Apr 24 '23 20:04

Salim Hamidi