From b622d4f76dbb43638e8950bac6a000fe6649eaa4 Mon Sep 17 00:00:00 2001 From: jaasen-livefront Date: Tue, 21 Oct 2025 11:37:17 -0700 Subject: [PATCH] move afterNextRender into constructor --- libs/components/src/callout/callout.component.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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() ?? "");