bug(mat-tree): How to control a tree expansion state if treeControl is deprecated?
- Lingua principale
- TypeScript
- Stelle
- 25k
- Fork
- 6.8k
- Merge medio
- 1g 8h
- PR unite (30g)
- 91
Descrizione
### 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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia esaminando la CdkTree API mostrata nell’issue e gli esempi esistenti della documentazione di mat-tree che usano treeControl. Determina come debba essere controllato lo stato di espansione con l’API non deprecata, quindi aggiorna le istruzioni e gli esempi in modo che la sostituzione sia esplicita e l’approccio documentato sia completo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- documentation, frontend
- Tipo di issue
- Documentazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100