Show property which includes html tags

后端 未结 3 1307
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 18:43

I\'ve an ember property which includes html tags (
, ,

, , and similar stuf

3条回答
  •  一整个雨季
    2020-12-29 19:03

    Ember 2.x, using JavaScript

    To make a string unescaped and output using Ember templates you can use htmlSafe helper.

    Ember.String.htmlSafe('
    someString
    ')

    The returned string will not be HTML escaped by Handlebars template engine.

    http://emberjs.com/api/classes/Ember.String.html#method_htmlSafe

    Use Handlebars Only

    Alternatively, you can pass the raw HTML to Handlebars template and get the raw HTML output by using triple brackets

    Inside Handlebars Template

    {{{raw_html_content}}}

提交回复
热议问题