Documentation Feedback
I noticed that the Table example with columns defined using a for loop features this code:
(element: PeriodicElement) => `${element.name}`
(element: PeriodicElement) => `${element.symbol}`
However, the use of template literals on these lines is completely unnecessary, since element.name and element.symbol are guaranteed to be strings. These lines should be replaced like this:
(element: PeriodicElement) => element.name
(element: PeriodicElement) => element.symbol
While it might look like a small issue, I believe that this example is one of the most important ones on the page, since most people would want to implement tables with dynamic columns. Therefore, people are likely to copy this code.
Affected documentation page
https://material.angular.dev/components/table/examples
Documentation Feedback
I noticed that the
Tableexample with columns defined using a for loop features this code:However, the use of template literals on these lines is completely unnecessary, since
element.nameandelement.symbolare guaranteed to be strings. These lines should be replaced like this:While it might look like a small issue, I believe that this example is one of the most important ones on the page, since most people would want to implement tables with dynamic columns. Therefore, people are likely to copy this code.
Affected documentation page
https://material.angular.dev/components/table/examples