12
<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
  • 806
  • 1
  • 8
  • 20

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
  • 623,577
  • 216
  • 2,003
  • 1,567
5

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

Reference

realappie
  • 4,656
  • 2
  • 29
  • 38