diff --git a/libs/components/src/callout/callout.component.ts b/libs/components/src/callout/callout.component.ts index 2054ff0b089..4211b2f4aa1 100644 --- a/libs/components/src/callout/callout.component.ts +++ b/libs/components/src/callout/callout.component.ts @@ -1,5 +1,4 @@ import { - AfterViewInit, Component, computed, ElementRef, @@ -43,7 +42,7 @@ let nextId = 0; templateUrl: "callout.component.html", imports: [A11yTitleDirective, SharedModule, TypographyModule], }) -export class CalloutComponent implements AfterViewInit { +export class CalloutComponent { readonly type = input("info"); readonly icon = input(); readonly title = input(); @@ -71,9 +70,7 @@ export class CalloutComponent implements AfterViewInit { private contentRef!: ElementRef; readonly contentText = signal(""); - constructor(private i18nService: I18nService) {} - - ngAfterViewInit() { + constructor(private i18nService: I18nService) { // use afterNextRender to ensure the DOM content is available afterNextRender(() => { this.contentText.set(this.contentRef?.nativeElement?.textContent?.trim() ?? "");