* 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
()
| 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 { |
no test coverage detected