Sets up the subscription that keeps the items list in sync.
()
| 184 | |
| 185 | /** Sets up the subscription that keeps the items list in sync. */ |
| 186 | private _setItems() { |
| 187 | // Since the items query has `descendants: true`, we need |
| 188 | // to filter out items belonging to a different menu. |
| 189 | this._allItems.changes |
| 190 | .pipe(startWith(this._allItems), takeUntil(this.destroyed)) |
| 191 | .subscribe((items: QueryList<CdkMenuItem>) => { |
| 192 | this.items.reset(items.filter(item => item._parentMenu === this)); |
| 193 | this.items.notifyOnChanges(); |
| 194 | }); |
| 195 | } |
| 196 | |
| 197 | /** Setup the FocusKeyManager with the correct orientation for the menu. */ |
| 198 | private _setKeyManager() { |