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

Method constructor

src/material/progress-bar/progress-bar.ts:115–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113 private _cleanupTransitionEnd: (() => void) | undefined;
114
115 constructor() {
116 const animationsState = _getAnimationsState();
117
118 const defaults = inject<MatProgressBarDefaultOptions>(MAT_PROGRESS_BAR_DEFAULT_OPTIONS, {
119 optional: true,
120 });
121
122 this._isNoopAnimation = animationsState === 'di-disabled';
123
124 if (animationsState === 'reduced-motion') {
125 this._elementRef.nativeElement.classList.add('mat-progress-bar-reduced-motion');
126 }
127
128 if (defaults) {
129 if (defaults.color) {
130 this.color = this._defaultColor = defaults.color;
131 }
132
133 this.mode = defaults.mode || this.mode;
134 }
135 }
136
137 /** Flag that indicates whether NoopAnimations mode is set to true. */
138 _isNoopAnimation: boolean;

Callers

nothing calls this directly

Calls 2

_getAnimationsStateFunction · 0.90
addMethod · 0.45

Tested by

no test coverage detected