MCPcopy Create free account
hub / github.com/angular/components / _updateDirectDescendants

Method _updateDirectDescendants

src/material/menu/menu.ts:514–521  ·  view source on GitHub ↗

* Sets up a stream that will keep track of any newly-added menu items and will update the list * of direct descendants. We collect the descendants this way, because `_allItems` can include * items that are part of child menus, and using a custom way of registering items is unreliable * when

()

Source from the content-addressed store, hash-verified

512 * when it comes to maintaining the item order.
513 */
514 private _updateDirectDescendants() {
515 this._allItems.changes
516 .pipe(startWith(this._allItems))
517 .subscribe((items: QueryList<MatMenuItem>) => {
518 this._directDescendantItems.reset(items.filter(item => item._parentMenu === this));
519 this._directDescendantItems.notifyOnChanges();
520 });
521 }
522
523 /** Gets the menu panel DOM node. */
524 private _resolvePanel(): HTMLElement | null {

Callers 1

ngAfterContentInitMethod · 0.95

Calls 2

resetMethod · 0.65
filterMethod · 0.45

Tested by

no test coverage detected