MCPcopy Index your code
hub / github.com/angular/components / closeAll

Method closeAll

src/cdk/menu/menu-stack.ts:164–175  ·  view source on GitHub ↗

* Pop off all MenuStackItems and emit each one on the `close` observable one by one. * @param options Options that configure behavior on close.

(options?: CloseOptions)

Source from the content-addressed store, hash-verified

162 * @param options Options that configure behavior on close.
163 */
164 closeAll(options?: CloseOptions) {
165 const {focusNextOnEmpty, focusParentTrigger} = {...options};
166 if (!this.isEmpty()) {
167 while (!this.isEmpty()) {
168 const menuStackItem = this._elements.pop();
169 if (menuStackItem) {
170 this._close.next({item: menuStackItem, focusParentTrigger});
171 }
172 }
173 this._empty.next(focusNextOnEmpty);
174 }
175 }
176
177 /** Return true if this stack is empty. */
178 isEmpty() {

Callers 9

closeMethod · 0.45
triggerMethod · 0.45
_forwardArrowPressedMethod · 0.45
_closeSiblingTriggersMethod · 0.45
menu-stack.spec.tsFile · 0.45
_handleKeyEventMethod · 0.45

Calls 2

isEmptyMethod · 0.95
nextMethod · 0.45

Tested by

no test coverage detected