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

Method _validateDrawers

src/material/sidenav/drawer.ts:1012–1040  ·  view source on GitHub ↗

Validate the state of the drawer children components.

()

Source from the content-addressed store, hash-verified

1010
1011 /** Validate the state of the drawer children components. */
1012 private _validateDrawers() {
1013 this._start = this._end = null;
1014
1015 // Ensure that we have at most one start and one end drawer.
1016 this._drawers.forEach(drawer => {
1017 if (drawer.position == 'end') {
1018 if (this._end != null && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1019 throwMatDuplicatedDrawerError('end');
1020 }
1021 this._end = drawer;
1022 } else {
1023 if (this._start != null && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1024 throwMatDuplicatedDrawerError('start');
1025 }
1026 this._start = drawer;
1027 }
1028 });
1029
1030 this._right = this._left = null;
1031
1032 // Detect if we're LTR or RTL.
1033 if (this._dir && this._dir.value === 'rtl') {
1034 this._left = this._end;
1035 this._right = this._start;
1036 } else {
1037 this._left = this._start;
1038 this._right = this._end;
1039 }
1040 }
1041
1042 /** Whether the container is being pushed to the side by one of the drawers. */
1043 private _isPushed() {

Callers 3

constructorMethod · 0.95
ngAfterContentInitMethod · 0.95
_watchDrawerPositionMethod · 0.95

Calls 1

Tested by

no test coverage detected