角度:检查是否提供了ng-content插槽之一

I have component template with multiple ng-content elements:

      <div class="form__general">
        <ng-content select="[general]"></ng-content>
      </div>

      <div class="form__footer">
        <ng-content select="[footer]"></ng-content>
      </div>

How can I check inside *ngIf condition is #footer is provided?

我尝试过类似的方法,但这不起作用:

      <div *ngIf="#footer" class="form__footer">
        <ng-content select="[footer]"></ng-content>
      </div>
评论