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

Method _validateDrawers

src/material/sidenav/drawer.ts:1032–1060  ·  view source on GitHub ↗

Validate the state of the drawer children components.

()

Source from the content-addressed store, hash-verified

1030
1031 /** Validate the state of the drawer children components. */
1032 private _validateDrawers() {
1033 this._start = this._end = null;
1034
1035 // Ensure that we have at most one start and one end drawer.
1036 this._drawers.forEach(drawer => {
1037 if (drawer.position == 'end') {
1038 if (this._end != null && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1039 throwMatDuplicatedDrawerError('end');
1040 }
1041 this._end = drawer;
1042 } else {
1043 if (this._start != null && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1044 throwMatDuplicatedDrawerError('start');
1045 }
1046 this._start = drawer;
1047 }
1048 });
1049
1050 this._right = this._left = null;
1051
1052 // Detect if we're LTR or RTL.
1053 if (this._dir && this._dir.value === 'rtl') {
1054 this._left = this._end;
1055 this._right = this._start;
1056 } else {
1057 this._left = this._start;
1058 this._right = this._end;
1059 }
1060 }
1061
1062 /** Whether the container is being pushed to the side by one of the drawers. */
1063 private _isPushed() {

Callers 3

constructorMethod · 0.95
ngAfterContentInitMethod · 0.95
_watchDrawerPositionMethod · 0.95

Calls 1

Tested by

no test coverage detected