I am having issue on displaying HTML data including inline style which get generated dynamically via Editor (eg. TinyMCE).
In fact, I have use the innerHTML
binding to display the html data. However, it ignore any inline style
.
For example:
I have the following sample data on component.ts
:
let sampleData = '<h1><span style="background-color: #ffff99;">Welcome to the sample demo!</span></h1> <p><span style="color: #ff0000;">Please try out the features provided in this basic example.</span>'
I am trying to display on component.html
:
<div innerHTML="{{ sampleData }}"></div>
Actual output is:
Welcome to the sample demo!
Please try out the features provided in this basic example.