0

I wanna create a kind of container component that modifies all (parent) tags listed in ng-content.

For example all tags within this container shall be wrapped within within a bootstrap-row to define responiveness.

Is this possible. Something like

            <ng-content *ngFor="let tag of tags"
              <row>{{tag}}<row>
            </ng-content>
user1786641
  • 101
  • 13

1 Answers1

1

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

<ng-content *ngFor="..." is pointless. It would create tags.length number of <ng-content> elements where only the first one ever takes effect.

You can achieve something like that using <template> and ngForTemplate or ngTemplateOutlet

See als

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567