angular - Angular2: How to display data in html format in angular2 data binding? -


this question has answer here:

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