使用MAT-RADIO组的嵌套无线电按钮在角度
我试图用嵌套的JSON数组显示嵌套的广播按钮。但是它无法正常工作。
<mat-radio-group aria-label="Select an option" formControlName="investmentCategory" fxLayout="column">
<mat-radio-button *ngFor="let category of investmentCategory" [value]="category.Investment_Category"
[matTooltip]="">{{category.Investment_Category}}
<mat-radio-group *ngIf="showSubCategory " aria-label="Select an option" formControlName="subInvestmentCat" fxLayout="column">
<mat-radio-button [checked]="false" *ngFor="let subCat of category.Sub_Category" [value]="subCat.Sub_Category"
[matTooltip]="">{{subCat.Sub_Category}}
</mat-radio-button>
</mat-radio-group>
</mat-radio-button>
</mat-radio-group>
有人可以帮我。提前致谢。
I am trying to display nested radio button with an nested json array. But its not working as expected.
<mat-radio-group aria-label="Select an option" formControlName="investmentCategory" fxLayout="column">
<mat-radio-button *ngFor="let category of investmentCategory" [value]="category.Investment_Category"
[matTooltip]="">{{category.Investment_Category}}
<mat-radio-group *ngIf="showSubCategory " aria-label="Select an option" formControlName="subInvestmentCat" fxLayout="column">
<mat-radio-button [checked]="false" *ngFor="let subCat of category.Sub_Category" [value]="subCat.Sub_Category"
[matTooltip]="">{{subCat.Sub_Category}}
</mat-radio-button>
</mat-radio-group>
</mat-radio-button>
</mat-radio-group>
Can someone help me out. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过将子组放置在内部的按钮外部,可以避免此问题:
You can avoid this problem by placing the sub-group outside the button not inside: