1

Why using consecutive angular ng-include does not work?

for example:

<div data-ng-include="'app/partials/partial1.html'" />
<div data-ng-include="'app/partials/partial2.html'" />

only show the content of partial1.html

but if I use:

<div>
    <div data-ng-include="'app/partials/partial1.html'" />
</div>
<div>
    <div data-ng-include="'app/partials/partial2.html'" />
</div>

Works fine, displays the content of both pages.

Thanks.

1 Answer 1

2

Add the ending tag for the divs:

<div data-ng-include="'app/partials/partial1.html'"></div>
Sign up to request clarification or add additional context in comments.

2 Comments

Why did we have to add the closing tag ? Self closing should be sufficient ? Is this a bug ?
I believe it is a quirk of the (some? most?) HTML parsers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.