Skip to content

feat(CDK Table): Able to inject row in cell #29114

Open
@keatkeat87

Description

@keatkeat87

Feature Description

The same feature request was made in 2019 but was rejected #15733.
Andrew Seguin did not explain why the Angular Material Team does not plan on supporting this case.
Over the past few years, Angular has changed a lot, so I am trying to ask again.

Use Case

wawa2
I am trying to do a hover header to show all cell border effects, similar to the Google Ads table (as shown in the GIF above).

My idea is to create two directives (Row and Cell).
Row listens to mouse enter events and then queries all Cell instances to call Cell.showBorder(). However, I know that Angular query is based on the LView tree, not the DOM tree, so the Row can't query its Cells.

I tried another way, where Cell injects its Row. However, this also didn't work. After checking the code, I found that when CdkTable creates cell embedded view, it does not specify injector
image
This is the reason why Cell cannot inject Row.

I'm not sure if the new Angular team will change their attention, but I hope to at least get an explanation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis issue represents a new feature or feature request rather than a bug or bug fixneeds: clarificationThe issue does not contain enough information for the team to determine if it is a real bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions