2017-04-27 29 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應用程序和角度的應用程序將你的網站裏面加載。