简体   繁体   中英

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:

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;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM