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