Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bind raw html in Aurelia

Using Aurelia, I want to fill an <div> with contents of viewmodel property (lets call it htmlText) which contains html text, and I was using

<div>
${htmlText}
</div>

However, this encodes html so, instead of i.e. having paragraph or link, all tags are escaped so html can be seen as source.

Is there out of the box binder to do this?

like image 512
Goran Obradovic Avatar asked Feb 01 '15 18:02

Goran Obradovic


1 Answers

You can accomplish this using the innerhtml binding like so:

<div innerhtml.bind="htmlText"></div>
like image 88
Matthew James Davis Avatar answered Oct 20 '22 19:10

Matthew James Davis