diff --git a/libs/components/src/callout/callout.component.html b/libs/components/src/callout/callout.component.html index 48af5c9665b..552f56a8d30 100644 --- a/libs/components/src/callout/callout.component.html +++ b/libs/components/src/callout/callout.component.html @@ -16,21 +16,11 @@ }
@if (title) { -
+
{{ title }}
} -
+
diff --git a/libs/components/src/callout/callout.component.ts b/libs/components/src/callout/callout.component.ts index 5afd9514dbd..59156600b15 100644 --- a/libs/components/src/callout/callout.component.ts +++ b/libs/components/src/callout/callout.component.ts @@ -1,14 +1,4 @@ -import { - AfterViewInit, - Component, - computed, - ElementRef, - input, - signal, - afterNextRender, - viewChild, - TemplateRef, -} from "@angular/core"; +import { Component, computed, input } from "@angular/core"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; @@ -46,7 +36,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(); @@ -70,19 +60,8 @@ export class CalloutComponent implements AfterViewInit { protected readonly titleId = `bit-callout-title-${nextId++}`; - readonly content = viewChild(TemplateRef); - private contentRef!: ElementRef; - readonly contentText = signal(""); - constructor(private i18nService: I18nService) {} - ngAfterViewInit() { - // prevent "Expression has changed after it was checked" errors - afterNextRender(() => { - this.contentText.set(this.contentRef?.nativeElement?.textContent?.trim() ?? ""); - }); - } - protected readonly calloutClass = computed(() => { switch (this.type()) { case "danger":