0

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:

1 Answer 1

1

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;
}
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the response. The row would be an array of objects using the md-data table with this example: codepen.io/anon/pen/vgNdJb but instead of a check box there would be a button
so, there is a icon or button, you can put here whatever you want, it should work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.