angular / angular/components

feat(cdk/tree): expose getDescendants method of CdkTree just like the deprecated TreeControl class

Ouverte
#29,609 1 commentaire 7 réactions 0 personnes assignées Voir sur GitHub
area: cdk/tree feature P4
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### Feature Description

Before v18.2, `TreeControl ` was used to control the whole tree and it exposes the `getDescendants ` publicly. After v18.2, the `getDescendants` was migrated to `CdkTree` ([source](https://github.com/angular/components/blob/1abb484aa72177a748eecdf9b850cc1c07d1a42b/src/cdk/tree/tree.ts#L889-L890)) but it was made private. Hence, all code that depends on `getDescendants` function will break and have no migration path for `TreeControl` users.

### Use Case

Allows developers to get all children and grandchildren without writing his own code or duplicating unnecessary code.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start in src/cdk/tree/tree.ts at the migrated getDescendants implementation referenced in the issue. Compare its current visibility with the deprecated TreeControl API and inspect nearby tree tests or public API conventions. Done means CdkTree exposes getDescendants for callers who previously used TreeControl.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
frontend
Type d'issue
Fonctionnalité
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.