0

I have a html content generated from my web api. This is passed on as json data to angular 2. I am using property binding to "inject" this content into a view. The process goes through successfully but angular 2 strips off all css styling

This how I am doing the binding

<div class="ReportViewerContent">
                <span [innerHTML]="reportData.Content"></span>
            </div>

This is what I am expecting (or some thing similar) per the sample application I am following which is not an agular app by the way enter image description here

and in my application this what I am getting enter image description here

How do I get angular 2 to ignore the inline styles that come along with the generated html string?

Tee-Jay
  • 736
  • 2
  • 9
  • 28
  • Looks like this question is already answered here [https://stackoverflow.com/questions/39794588/angular2-innerhtml-removes-styling?rq=1][1] – Sandeep Rao Jul 11 '17 at 13:47
  • Ah!!! Thanks alot !!!!! – Tee-Jay Jul 11 '17 at 14:05
  • Possible duplicate of [Angular2 innerHtml removes styling](https://stackoverflow.com/questions/39794588/angular2-innerhtml-removes-styling) – ruffin Oct 20 '18 at 15:04

0 Answers0