【发布时间】:2017-04-09 23:19:32
【问题描述】:
我将数据显示为表格。用户必须从表中选择一行。所以我尝试使用<md-radio-button>,但它抛出了一个错误,提示缺少<md-radio-group> 指令。谁能告诉我如何在 ng-repeat 中使用<md-radio-button>?
<table md-table>
<thead md-head>
<tr>
<td md-cell></td>
<td md-cell>ID</td>
<td md-cell>Demand</td>
<td md-cell>Code</td>
</tr>
</thead md-head>
<tbody md-body>
<md-radio-group ng-model="test" class="md-primary">
<tr md-row ng-repeat="cluster in clusters">
<td md-cell>
<md-radio-button ng-value="cluster.checked"/>
</td>
<td md-cell>{{cluster.id}}</td>
<td md-cell>{{cluster.demand}}</td>
<td md-cell>{{cluster.code}}</td>
</tr>
</md-radio-group>
</tbody>
</table>
【问题讨论】:
标签: javascript angularjs radio-button angularjs-ng-repeat