Needs improvement: MatTextColumn is calling dataAccessor method inside the template.
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
### Description
Call of `dataAccessor` method is against Angular best practices and will be bad for performance in tables with large data sets.
{{dataAccessor(data, name)}}
See [line 30 inside `MatTextColumn` for reference](https://github.com/angular/components/blob/main/src/material/table/text-column.ts#L30C11-L30C35).
### Reproduction
See [the Stackblitz and the example for `mat-text-column` inside the documentation here for a working example](https://material.angular.io/components/table/examples#table-text-column).
### Expected Behavior
Set the data in a variable inside the component on initialization and bind that to the template instead.
### Actual Behavior
It gets the data inside the template by calling the `dataAccessor` method.
### Environment
- Angular:
- CDK/Material:
コントリビューションガイド
調査の方向性
Start by reading src/material/table/text-column.ts around line 30, then run the mat-text-column documentation example and its linked Stackblitz to observe the current behavior. Done means the template no longer calls dataAccessor for each table render, while the example continues to display the expected cell values.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend
- issue の種類
- リファクタリング
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100