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

Method constructor

src/cdk/listbox/listbox.ts:447–460  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

445 private _previousActiveOption: CdkOption<T> | null = null;
446
447 constructor() {
448 if (this._isBrowser) {
449 const renderer = inject(Renderer2);
450
451 this._cleanupWindowBlur = this.ngZone.runOutsideAngular(() => {
452 return renderer.listen('window', 'blur', () => {
453 if (this.element.contains(document.activeElement) && this._previousActiveOption) {
454 this._setActiveOption(this._previousActiveOption);
455 this._previousActiveOption = null;
456 }
457 });
458 });
459 }
460 }
461
462 ngAfterContentInit() {
463 if (typeof ngDevMode === 'undefined' || ngDevMode) {

Callers

nothing calls this directly

Calls 2

_setActiveOptionMethod · 0.95
listenMethod · 0.80

Tested by

no test coverage detected