Open DmitryEfimenko opened 4 years ago
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
Proposal
Unless there's another way to achieve my goal (see the Use Case), I'd like to split what's currently known as
CdkCellDef
object into aCdkCellDef
and aCdkCellContentDef
. TheCdkCellDef
would serve the purpose of aviewContainer
where the content of the cell goes.Use Case
I'm working on a library that will extend cdk-table with extra functionality. My library does not "know" what flavor of a table the consumer application is using. It could be a cdk-table, a mat-table, or any other table that extends cdk-table.
The library I'm working on needs to be able to add a column to the table. The column needs to match the column styles from the consuming app. However, there is no
@ContentChild(CellTemplateDefinition)
that I could query that would give me just the template of the cell. Here's a concrete example:Consumer application has the following table:
There's no way I can use information from this table to add my custom column while using cell definition from the child table. Hopefully the code example below illustrates the issue:
Proposed API:
The table would have to be created as follows:
This way the templates for the cells are separated from the templates for cell contents. The
matCellDef
serves the purpose of the viewContainer, the same way as thematRowDef
.I know that this particular example means a breaking change. I'm not sure if it's possible to achieve this without a breaking change. Thoughts?