0

I'm trying to bind a complex, multiline rich text element with AngularJS, say something like:

<h1>Title</h1>
<p>Some content</p>
<p>More Content maybe with <i>italics</i> or <strong>bold</strong></p>
<p><a href="#">Even links</a></p>

Now, when trying to render using a simple ng-bind-html it only binds the first element (in this example, the h1) and it does so inside a p tag, so the tag isn't applied, the rest is left below as a literal string.

How can I make it so Angular takes the entire multiline response and renders it accordingly?

Another issue I'm having is that if the HTML to render has some space before the line starts (that is, if it's at all tabulated) then it simply will print out the tab inside the

tag and leave all the content as the string literal.

Danyx
  • 574
  • 7
  • 34

0 Answers0