本文介绍了Angular标记在浏览器中提供HTML输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 {{testimonial.TestimonialText}}< small class =by-line>< i> {{testimonial.CoupleName}}< / i> 
< br />
< span class =location> {{testimonial.CoupleLocation}}< / span>
< / small>





我尝试过:
$ b $ {{testimonial.TestimonialText}}的
给出了带有html标签的文本输出我希望html在浏览器中被解释,但是他们正在浏览器中显示我试图解释与jquery但没有这样做,我试图使用@ HTML.Raw,但这是剃刀语法,不能在角标签上使用我是角度新手,不知道如何解决这个问题。

解决方案




{{ testimonial.TestimonialText }}<small class="by-line"><i>{{ testimonial.CoupleName }}</i>
<br/>
    <span class="location">{{ testimonial.CoupleLocation }}</span>
</small>



What I have tried:

for {{ testimonial.TestimonialText}} gives text output with html tags in it i want the html to be interpreted in browser but they
are being shown in browser i have tried to interpret with jquery but failed to do so and i tried to use @HTML.Raw but that is razor syntax which can't be used on angular tag i am new to angular and don't know how to get around this.

解决方案




这篇关于Angular标记在浏览器中提供HTML输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 12:21
查看更多