Pedro Perez
Pedro Perez

Reputation: 932

using angularjs consecutive ng-include directive

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.

Upvotes: 1

Views: 100

Answers (1)

Nikos Paraskevopoulos
Nikos Paraskevopoulos

Reputation: 40318

Add the ending tag for the divs:

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

Upvotes: 2

Related Questions