Flash
Flash

Reputation: 1014

Angular Material Data Table contents within row

When you have a table using md-data-table, How do you get the data for a particular row. Basically each row has a menu button and once they click on that button the data in that row should be saved in a variable:

Upvotes: 0

Views: 320

Answers (1)

Nikita Glusuchenko
Nikita Glusuchenko

Reputation: 167

html :

 <td md-cell>
    <label>{{item.count}}</label>
    <i ng-click="setSomeVar(item)">you_icon</i>
</td>

method in controller :

$scope.setSomeVar = function(item)
{
    $scope.someVar = item.count;
}

Upvotes: 1

Related Questions