Is there a way to eliminate padding on the "dropdown-menu" <ul>
tag when the list is empty, so that no space is displayed in place of the padding? I want to avoid using .dropdown{padding: 0}
because it will remove necessary padding when the list is not empty. However, using .dropdown:empty{padding:0}
does not work since the content is filtered by an *ngIf statement (I assume, even though Angular removes the element from the DOM).
<ul role="menu" class="dropdown-menu">
<li *ngFor="let option of options">
<span *ngIf="option.condition;then template1 else template2">
</span>
<ng-template #template1>some content</ng-template>
<ng-template #template2>some content</ng-template>
</li>
</ul>