11
<div class="main">
  <ng-content select="[body]"></ng-content>
</div>
<div class="main-copy">
  <ng-content select="[body]"></ng-content>
</div>

I am trying to copy the same content into main-copy but unfortunately it is not working.

Any suggestion?

Ashutosh Singh
  • 726
  • 1
  • 7
  • 19

2 Answers2

5

update Angular 5

ngOutletContext was renamed to ngTemplateOutletContext

See also https://github.com/angular/angular/blob/master/CHANGELOG.md#500-beta5-2017-08-29

original

No, that's not supported.

Every element matching the selector will be projected to the first <ng-content>.

Perhaps ngTemplateOutlet or ngForTemplate is what you're looking for.

See also

Günter Zöchbauer
  • 558,509
  • 191
  • 1,911
  • 1,506
4

For future references, here is a working example of multiple transclusion which utilizes ngTemplateOutlet.

Reference

realappie
  • 4,205
  • 2
  • 26
  • 38