Skip to content

docs-bug(Table): The Table example with columns defined using a for loop should be improved #33457

Description

@hb20007

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: material.angular.iodocsThis issue is related to documentationgemini-triagedLabel noting that an issue has been triaged by geminineeds triageThis issue needs to be triaged by the team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions