NVG NVG - 1 year ago 215
AngularJS Question

Angularjs : How to use <md-radio-button> inside <table> with ng-repeat

I am displaying data as a table. The user has to select a row from the table. So I tried using

, But it is throwing an error saying
directive is missing. Could anyone tell me how to use
inside with ng-repeat?

<table md-table>
<thead md-head>
<td md-cell></td>
<td md-cell>ID</td>
<td md-cell>Demand</td>
<td md-cell>Code</td>
</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 md-cell>{{cluster.id}}</td>
<td md-cell>{{cluster.demand}}</td>
<td md-cell>{{cluster.code}}</td>

Answer Source

Here is the code,

  <md-radio-group ng-model="cc.selectedIndex">
    <div ng-repeat='person in cc.contacts' class="row">
      <div flex layout='row' layout-padding layout-align="start center">
        <div flex style="max-width:200px;">
        <md-radio-button ng-value="person.ID" class="md-primary">


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download