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

Function _setItems

src/cdk/menu/menu-base.ts:186–195  ·  view source on GitHub ↗

Sets up the subscription that keeps the items list in sync.

()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 2

resetMethod · 0.65
filterMethod · 0.45

Tested by

no test coverage detected