2017-04-27 81 views

回答

3

您可以运行角度应用程序并将其加载到iframe中。在你的应用程序中,你应该创建一个只有一个组件可见的路线。然后你可以将它加载到其他网站的iframe中。

例:你的组件将可在http://localhost:4200/components/card

,然后在你的网站,你可以加载它: <iframe src="http://localhost:4200/components/card></iframe>

1

比方说你的角度应用在http://localhost:4200托管这是默认的URL,当您运行ng serve

应用只需添加<iframe src='http://localhost:4200'>在你的web应用程序和角度的应用程序将你的网站里面加载。