this question has answer here:
- angular 2 html binding 15 answers
i have product data database contains title, description... description in html format string, this:
<b>name:</b> iphone 5;<br> <b>membery:</b> 8gb;<br> <b>condition:</b> brand new;<br />
if supposed displayed this:
name: iphone 5;
memory: 8gb;
condition: brand new
but when use data-binding in angular2: {{product.description}}, displays pure text:
<b>name:</b> iphone 5; <br /><b>memory:</b> 8gb;<br /><b>condition:</b> brand new;<br />
how should display correctly html ? there no html filter binding.
you can bind innerhtml
:
<div [innerhtml]="product.description"></div>
Comments
Post a Comment