MCPcopy
hub / github.com/angular/components / _setContainerClass

Method _setContainerClass

src/material/sidenav/drawer.ts:1000–1009  ·  view source on GitHub ↗

Toggles the 'mat-drawer-opened' class on the main 'mat-drawer-container' element.

(isAdd: boolean)

Source from the content-addressed store, hash-verified

998
999 /** Toggles the 'mat-drawer-opened' class on the main 'mat-drawer-container' element. */
1000 private _setContainerClass(isAdd: boolean): void {
1001 const classList = this._element.nativeElement.classList;
1002 const className = 'mat-drawer-container-has-open';
1003
1004 if (isAdd) {
1005 classList.add(className);
1006 } else {
1007 classList.remove(className);
1008 }
1009 }
1010
1011 /** Validate the state of the drawer children components. */
1012 private _validateDrawers() {

Callers 1

_watchDrawerToggleMethod · 0.95

Calls 2

removeMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected