angular / angular/components

bug(mat-tree): How to control a tree expansion state if treeControl is deprecated?

オープン
#29,856 コメント 3 件 リアクション 14 件 担当者 0 名 GitHub で見る
area: material/tree docs P2
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

mat-tree has [treeControl] (and many other related classes and parts) deprecated. How are we supposed to control the expansion state of the tree from our component if there is to no treeControl? Was this an oversight in documentation? even your own examples in the documentation use the deprecated features!

### Reproduction

N/A

### Expected Behavior

I expect deprecated features / componenets / classes to have a new replacement or documentation on HOW to use the new way of doing things that accounts for the deprecated feature.

### Actual Behavior

In this case (CdkTree):

```
/**
* The tree controller
*
* @deprecated Use one of `levelAccessor` or `childrenAccessor` instead. To be removed in a
* future version.
* @breaking-change 21.0.0
*/
treeControl?: TreeControl;
```
levelAccessor and childrenAccessor have nothing to do with expansion state. Please tell us what we are supposed to use in place of treeControl!

### Environment

- Angular: 18.2.2
- CDK/Material: 18.2.2
- Browser(s): N/A
- Operating System (e.g. Windows, macOS, Ubuntu): N/A

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、issue に示されている CdkTree API と、treeControl を使用している既存の mat-tree ドキュメント例を確認します。非推奨ではない API で展開状態をどのように制御すべきかを判断し、そのうえで、置き換え方法が明示され、文書化されたアプローチが完全なものになるようにガイダンスと例を更新します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
documentation, frontend
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。