将脚本添加到Angular中的组件视图

时间:2018-08-24 12:28:40

标签: angular angular6

如何在Angular的组件视图中添加脚本?如果我在component.html中编写它,它将在html页面的视图源中消失,但是我设法使用DOM sanitizer添加了脚本,并且在执行视图源时可以在页面的源代码中看到script标签,但angular只会忽略它。

这是我要添加到页面的脚本

<script 
  type='text/javascript' 
  src='https://test-www.payson.se/embedded/Content/payson.js?v2'>
</script>

0 个答案:

没有答案
相关问题