ov-components: Configures root injection for overlay

Configures root injection for the CDK overlay container.

This ensures the overlay container is properly initialized and available throughout the application.
It also makes the overlay available application wide and solves the problem of injecting multiple instances.
pull/856/head
Carlos Santos 2025-10-21 19:10:27 +02:00
parent 1a3edb9a61
commit bb47c3696c
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,9 @@
import { OverlayContainer } from '@angular/cdk/overlay';
import { Injectable } from '@angular/core';
@Injectable()
@Injectable({
providedIn: 'root'
})
export class CdkOverlayContainer extends OverlayContainer {
private readonly cdkContainerClass: string = '.cdk-overlay-container';
private defaultSelector = 'body';

View File

@ -38,7 +38,7 @@ export class OpenViduComponentsModule {
BroadcastingService,
// CaptionService,
CdkOverlayContainer,
{ provide: OverlayContainer, useClass: CdkOverlayContainer },
{ provide: OverlayContainer, useExisting: CdkOverlayContainer },
ChatService,
DeviceService,
DocumentService,