File

/home/workflows/workspace/libs/design-system/indicators/error-indicator/src/lib/error-indicator.component.ts

Description

Error Indicator component

Metadata

Index

Inputs

Inputs

actionLink
Type : string

Call to action link

actionLinkLabel
Type : string

Call to action link label

errors
Type : string[]

List of errors to be shown in the indicator

import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { HraCommonModule } from '@hra-ui/common';
import { TextHyperlinkDirective } from '@hra-ui/design-system/buttons/text-hyperlink';

/** Error Indicator component */
@Component({
  selector: 'hra-error-indicator',
  imports: [HraCommonModule, MatIconModule, TextHyperlinkDirective],
  templateUrl: './error-indicator.component.html',
  styleUrl: './error-indicator.component.scss',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ErrorIndicatorComponent {
  /** List of errors to be shown in the indicator */
  readonly errors = input<string[]>();

  /** Call to action link */
  readonly actionLink = input<string>();

  /** Call to action link label */
  readonly actionLinkLabel = input<string>();
}
<mat-icon>error</mat-icon>
<div class="errors" hraFeature="error-indicator">
  @for (error of errors(); track error) {
    <div class="error">
      {{ error }}
    </div>
  }
  @if (actionLink()) {
    <a class="link" hraHyperlink [attr.href]="actionLink()">{{ actionLinkLabel() }}</a>
  }
</div>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""