0

I use CKEditor in my AngularJS Application. When I try to display the text that I saved from the TextEditor, it doesn't take the style. For Example if I want to display a sentence it appears as:

<p>How old are you</p>

instead of :

How old are you

I tried using ng-bind:

<div ng-bind="Item.Header"></div>

and the regular binding method:

<h3>{{Item.Header}}</h3>

But both methods didn't work. Is there a solution for this issue?

oleq
  • 15,697
  • 1
  • 38
  • 65
Sana Joseph
  • 1,948
  • 7
  • 37
  • 58

1 Answers1

2

You should use "ngBindHtmlUnsafe". Since this command doesn't sanitize the expression, but you should only use it if you trust the source.

So the html will be written as follows:

<div ng-bind-html-unsafe="Item.Header"></div>
Sana Joseph
  • 1,948
  • 7
  • 37
  • 58