angular / angular/components

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

Abierto
#29,856 3 comentarios 14 reacciones 0 asignados Ver en GitHub
area: material/tree docs P2
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza revisando la CdkTree API mostrada en la issue y los ejemplos existentes de la documentación de mat-tree que usan treeControl. Determina cómo debe controlarse el estado de expansión con la API no obsoleta y, después, actualiza la guía y los ejemplos para que el reemplazo sea explícito y el enfoque documentado esté completo.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
documentation, frontend
Tipo de issue
Documentación
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.