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

Method constructor

src/material/timepicker/timepicker.ts:216–242  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214 readonly panelClass = input<string | string[]>();
215
216 constructor() {
217 if (typeof ngDevMode === 'undefined' || ngDevMode) {
218 validateAdapter(this._dateAdapter, this._dateFormats);
219
220 effect(() => {
221 const options = this.options();
222 const interval = this.interval();
223
224 if (options !== null && interval !== null) {
225 throw new Error(
226 'Cannot specify both the `options` and `interval` inputs at the same time',
227 );
228 } else if (options?.length === 0) {
229 throw new Error('Value of `options` input cannot be an empty array');
230 }
231 });
232 }
233
234 // Since the panel ID is static, we can set it once without having to maintain a host binding.
235 const element = inject<ElementRef<HTMLElement>>(ElementRef);
236 element.nativeElement.setAttribute('mat-timepicker-panel-id', this.panelId);
237 this._handleLocaleChanges();
238 this._handleInputStateChanges();
239 this._keyManager.change.subscribe(() =>
240 this._activeDescendant.set(this._keyManager.activeItem?.id || null),
241 );
242 }
243
244 /** Opens the timepicker. */
245 open(): void {

Callers

nothing calls this directly

Calls 5

_handleLocaleChangesMethod · 0.95
validateAdapterFunction · 0.90
setMethod · 0.80
optionsMethod · 0.45

Tested by

no test coverage detected