How do you use ng-container in combination with ng-content that has a select tag.
<div class="container">
<div id="first">
<ng-container *ngTemplateOutlet="widgetContent"></ng-container>
<div>
<div id="second">
<ng-container *ngTemplateOutlet="widgetContent"></ng-container>
</div>
</div>
<ng-content #widgetContent select="side-widget, [sidewidget]"></ng-content>
Try this
<div class="container">
<div id="first">
<ng-container [ngTemplateOutlet]="widgetContent"></ng-container>
<div>
<div id="second">
<ng-container [ngTemplateOutlet]="widgetContent"></ng-container>
</div>
</div>
<ng-template #widgetContent>
<ng-content></ng-content>
</ng-template>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.