簡體   English   中英

如何在 div 中加載外部 Angular 應用程序?

[英]How to load an external Angular app inside a div?

我需要創建一個用作小部件的單頁應用程序日歷 web 應用程序,因此客戶可以將其插入到他們網站上的指定 div 容器中。 我怎樣才能做到這一點?

Angular 是否適合這項任務?

試試下面的代碼:

 HTML: <div [innerHtml]="KisshtHtml"></div> Ts: name = 'Kissht'; KisshtHtml: any; constructor(private http:HttpClient, private sanitizer:DomSanitizer){ } ngOnInit(){ this.http.get('https://razorpay-dbf86.web.app/',{responseType:'text'}).subscribe(res=>{ this.KisshtHtml = this.sanitizer.bypassSecurityTrustHtml(res); }) }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM