简体   繁体   English

如何在外部 html div 容器中包含我的 angular 应用程序/网站?

[英]How to include my angular app/website in external html div container?

This is the URL of my website http://35.154.165.122/#/iLeadLandPage .这是我的网站http://35.154.165.122/#/iLeadLandPage 的 URL The whole website is made in Angular.整个网站是用Angular制作的。

What I need to do is I need to include this website into another HTML webpage.我需要做的是我需要将此网站包含到另一个 HTML 网页中。 I need to include this website into another div container of a new HTML page.我需要将此网站包含到新 HTML 页面的另一个div容器中。

I need to do something similar to this.我需要做类似的事情。 I am including a new URL into a div in a new webpage我在新网页的 div 中包含一个新的 URL

...........
<div id="gabriel-embed" style="min-height: 800px;">
<script src="https://embed.gabrielny.com/eshopreact.js?key=1d767b46-27e8-4b05-8abf-776514fc9771&division=fashion&noframe=1&attachTo=gabriel-embed&eager=1"> </script>
</div> ............

How can I do this for my Angular app?如何为我的 Angular 应用程序执行此操作?

I need to replace the src in this with my Angular app's IP so that whenever I make a new HTML file the component get loaded.我需要用我的 Angular 应用程序的 IP 替换其中的src ,这样每当我创建一个新的 HTML 文件时,组件就会被加载。

How can I achieve this?我怎样才能做到这一点?

You can embed it inside an <object> tag using this:您可以使用以下方法将其嵌入到<object>标记中:

document.getElementById("gabriel-embed").innerHTML=<object type="text/html" data="http://example.com"></object>

Be aware of using the same protocol (HTTP/HTTPS) for both resources, otherwise the browser won't allow this请注意对两种资源使用相同的协议(HTTP/HTTPS),否则浏览器将不允许这样做

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用angular 2容器应用程序与外部HTML通信 - How to communicate and external HTML with angular 2 container app 如何在 div 中加载外部 Angular 应用程序? - How to load an external Angular app inside a div? 如何在我的React应用程序中打开外部网站 - How to open external website in my React app 如何在现有的html文件和网站中包含Angular 7应用程序? - How to include an Angular 7 application in an existing html file and website? 在 HTML 中包含外部 Javascript 文件 - Angular 2 - Include External Javascript files in HTML - Angular 2 如何在我的IOS应用程序中包含HTML页面的js文件? - How to include the js files of my html page in my IOS app? 在其他域的div中包含角度应用,不包含iframe - Include an angular app in a div on an other domain, no iframe 如何将外部HTML添加到div - How to add external html into a div 在我的aspx页面中显示外部网站,并包含自己的JavaScript - Show external website in my aspx page and include own javascript 在javascript / html中,如何获得外部网站(例如div)的一部分并将其设置在我的网站上? - In javascript/html, how can I get a part of an external website (such as a div) and set it onto mine?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM