angular / angular/components

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

Aperta
#29,609 1 commento 7 reazioni 0 assegnatari Vedi su GitHub
area: cdk/tree feature P4
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.