I\'m trying to get the index of row in table, in html, which has been implemented using angular material v5.2. Is there any method available to get the index?
The co
Using indexOf is an enormous waste of resources. The right way is initializing a variable with index's value, like this:
Num.
{{i + 1}}
https://material.angular.io/components/table/examples
UPDATE:
If you are using pagination the index can be calculated this way:
Num.
{{this.paginator.pageIndex == 0 ? i + 1 : 1 + i + this.paginator.pageIndex * this.paginator.pageSize}}