在html中,代码如下:
<div class="detail-style">
<div [innerHTML]="html" *ngIf="html"></div>
</div>html是一些html标记,如下所示:
<div><span>test</span></div>
<attach onclick="downloadAttach('attachName', 'attachPath')">click this to download attach</attach>它可以正常显示,当我单击attach时,它会抛出downloadAttach is not defined异常,但我在ts文件中定义了downloadAttach方法。我不知道如何解决这个问题,problem.it花了我一天的时间。非常非常感谢你对我的帮助。
发布于 2017-05-19 17:42:15
创建
<script>function downloadAttach(){...}</script>在你的index.html中
https://stackoverflow.com/questions/44065886
复制相似问题