@engie-group/fluid-design-system-angular
Version:
Fluid Design System Angular
19 lines (18 loc) • 771 B
HTML
<p class="nj-badge"
[ngClass]="[getBadgeEmphasisClass(), getBadgeVariantClass(), getBadgeSizeClass(), getBadgeUppercaseClass()]">
<span class="nj-badge__icon" *ngIf="customIcon?.templateRef || iconName">
<ng-container *ngIf="customIcon?.templateRef as iconTemplateRef; else icon" [ngTemplateOutlet]="iconTemplateRef"></ng-container>
<ng-template #icon>
<nj-icon [name]="iconName" variant="inherit" size="inherit"></nj-icon>
</ng-template>
</span>
<span>
<ng-container *ngIf="!isValueDefined()">
<ng-content></ng-content>
</ng-container>
<ng-container *ngIf="isValueDefined()">
{{ getFormattedValue() }}
</ng-container>
</span>
<span *ngIf="unitLabel" class="nj-sr-only">{{ unitLabel }}</span>
</p>