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

Method _setContainerClass

src/material/sidenav/drawer.ts:1020–1029  ·  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

1018
1019 /** Toggles the 'mat-drawer-opened' class on the main 'mat-drawer-container' element. */
1020 private _setContainerClass(isAdd: boolean): void {
1021 const classList = this._element.nativeElement.classList;
1022 const className = 'mat-drawer-container-has-open';
1023
1024 if (isAdd) {
1025 classList.add(className);
1026 } else {
1027 classList.remove(className);
1028 }
1029 }
1030
1031 /** Validate the state of the drawer children components. */
1032 private _validateDrawers() {

Callers 1

_watchDrawerToggleMethod · 0.95

Calls 2

removeMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected