AngularJS–don’t use self-closing div tags

I had a piece of code that gave strange results in AngularJS. The issue was that I used a self closing <div /> tag instead of <div>…</div>. Self closing div tags are not supported in HTML5. The complete code can be found at and the plunker

My wrong code was written as:

<script id="paragraphTmpl.html" type="text/ng-template">
    <!-- comment line below to have the paragraphs render correctly --> 
    <div ng-bind-html="trustAsHtml(paragraph.Content)"/>
    <ng-include ng-repeat="paragraph in paragraph.Paragraphs" 

<div> <h3>{{chaptercontent.Title}}</h3>

&lt;div ng-bind-html=&quot;trustAsHtml(chaptercontent.Content)&quot;/&gt;
&lt;ng-include ng-repeat=&quot;paragraph in chaptercontent.Paragraphs&quot; 


It works fine when jQuery is included, but not when you use the AngularJS JQLite implementation.
When <div ng-bind-html="trustAsHtml(chaptercontent.Content)"></div> is used, the code works correctly.

No Comments