angular / angular/components

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

Offen
#29,856 3 Kommentare 14 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/tree docs P2
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

### 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie damit, die in der Issue gezeigte CdkTree API und die vorhandenen mat-tree-Dokumentationsbeispiele zu überprüfen, die treeControl verwenden. Ermitteln Sie, wie der Erweiterungszustand mit der nicht veralteten API gesteuert werden sollte, und aktualisieren Sie anschließend die Anleitung und Beispiele so, dass der Ersatz explizit ist und der dokumentierte Ansatz vollständig ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
documentation, frontend
Issue-Typ
Dokumentation
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.