rogergl
rogergl

Reputation: 3771

How to render handlebars template to HTML string in ember

I would like to know how to translate

 var template = Handlebars.compile( $( '#row-tpl' ).html() ); 

within Ember.

I defined a template in products.js like this:

{{ProductName}}

That creates: Ember.TEMPLATES.products

But how do I render this to pure html ? I need the html to set the content for a KendoUI window.

Regards Roger

Upvotes: 1

Views: 2754

Answers (2)

Alberto
Alberto

Reputation: 91

I know this is an older question/answer. But in the event of someone landing here I just wanted to update the accepted answer

from having this in the template

{{{safehtml}}

instead return this from your computed property

return Ember.String.htmlSafe(ProductName);

Upvotes: 1

Surender
Surender

Reputation: 757

Use {{{ProductName}}} instead of {{ProductName}}.

Upvotes: 5

Related Questions