按the example放置Angular供电的Bootstrap单选按钮时,这些按钮看起来不错。但是,如果具有 btn-group-toggle 类的元素不是直接父元素,则按钮会突然显示单选按钮乳头,如下图所示。如何在嵌套元素中布置非哺乳动物的单选按钮?
html模板:
<table class="table">
<tr class="btn-group btn-group-toggle" ngbRadioGroup>
<th>Numbers</th>
<th *ngFor="let month of [1,2,3,4]">
<label ngbButtonLabel class="btn btn-primary">
<input ngbButton type="radio" [value]="month" />{{month}}
</label>
</th>
</tr>
</table>
<div class="btn-group btn-group-toggle" ngbRadioGroup>
<label ngbButtonLabel class="btn btn-primary" *ngFor="let month of [1,2,3,4]">
<input ngbButton type="radio" [value]="month" />{{month}}
</label>
</div>