Skip to content

feat(table): typescript/strong typing of cell templates #22290

Open
@andreialecu

Description

@andreialecu

Feature Description

Currently, *matCellDef types the resulting variable as any:

Screenshot 2021-03-19 at 11 29 32

This issue is an attempt to bring #16273 back in discussion, which has been closed as Ivy wasn't yet available.

There has been some progress on several fronts:

  • Ivy now has strictTemplates mode.
  • The experimental Ivy powered language server is almost ready to go.

It appears that the approach described in this comment angular/angular#28731 (comment) might allow this to be implemented.

Use Case

As we've been converting more code to use Material Data Tables, the lack of strong typing has been really problematic, and it feels like a downgrade in developer experience compared to regular tables with *ngFor.

Further motivation for this has been described in:

#16273
angular/angular#28731

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/tablefeatureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions