猿问

在角度项目中加载非角度html页面和javascript

我正在使用Core UI模板在Angular 7上进行项目。我有一个用纯HTML编写的页面,它使用了一些JavaScript,当用户单击某些内容时,我想加载此页面。此页面不是角度模块/组件。


我尝试加载另一个Angular模块,然后加载其中需要页面的html,但是它不起作用。我的直觉说这不是要走的路。


我正在使用的代码如下所示:


By clicking <span class="here" (click)="loadNonAngularPage()">here</span> you can load a non angular page.

调用的函数是这样的:


  public loadNonAngularPage(){

    this.router.navigateByUrl('/non angular page')

  }

有任何想法吗?


哆啦的时光机
浏览 141回答 1
1回答

慕丝7291255

<iframe>如果您仍想使用角度应用程序,则可以使用;window.location.href = '...';如果要更改为其他网页,则可以使用。&nbsp; public loadNonAngularPage(){&nbsp; &nbsp; &nbsp; &nbsp;window.location.href = '/non angular page';&nbsp; }
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答