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

Method _updateDirectDescendants

src/material/menu/menu.ts:516–523  ·  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

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

Callers 1

ngAfterContentInitMethod · 0.95

Calls 2

resetMethod · 0.65
filterMethod · 0.45

Tested by

no test coverage detected