简体   繁体   English

行内的角度材料数据表内容

[英]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. 当您有一个使用md-data-table的表时,如何获取特定行的数据。 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 : 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;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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