feat(aria/grid): add CDK table interop - #33859
Open
TomaszKasowicz wants to merge 1 commit into
Open
TomaszKasowicz wants to merge 1 commit into
TomaszKasowicz wants to merge 1 commit into
Conversation
Adds interoperability directives which allow users to use `ngGrid` with CDK tables. In native table `<tr ngGridRow>` is always a parent of `<td ngGridCell>`. However in CDK table `<td>` elements are defined outside of `<tr>` elements. This commit adds directives which allow users to bridge `ngGridRow` and `ngGridCell`. Usage: ```typescript @component({ template: ` <table cdk-table role="grid" ngGrid> <ng-container cdkColumnDef="name"> <th ngGridCell ngProvideGridRowForCdk cdk-header-cell *cdkHeaderCellDef>Name</th> <td ngGridCell ngProvideGridRowForCdk cdk-cell *cdkCellDef="let row">{{ row.name }}</td> </ng-container> <tr ngGridRow ngRegisterGridRowForCdk cdk-header-row *cdkHeaderRowDef="displayedColumns"></tr> <tr ngGridRow ngRegisterGridRowForCdk cdk-row *cdkRowDef="let row; columns: displayedColumns"></tr> </table> `, providers: [NgGridRowRegistryForCdk], }) export class CdkTableInteropComponent { readonly displayedColumns = ['name']; } ``` Fixes: angular#32603
TomaszKasowicz
force-pushed
the
feat-ngrid-cdk-interop
branch
from
September 23, 2026 14:30
6b8640d to
31051cb
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds interoperability directives which allow users to use
ngGridwith CDK tables. In native table<tr ngGridRow>is always a parent of<td ngGridCell>. However in CDK table<td>elements are defined outside of<tr>elements. This commit adds directives which allow users to bridgengGridRowandngGridCell. Usage:NOTE: This is a proposal. Feel free to reject this PR if You think it's not suitable
Fixes: #32603