1 import {Component, Input} from '@angular/core';
3 /* Simple component to render a boolean value as human-friendly text */
9 <span *ngIf="value" class="badge badge-success" i18n>Yes</span>
10 <span *ngIf="value == false" class="badge badge-secondary" i18n>No</span>
11 <ng-container *ngIf="value === null">
12 <span *ngIf="ternary" class="badge badge-light" i18n>Unset</span>
13 <span *ngIf="!ternary"> </span>
16 export class BoolDisplayComponent {
19 @Input() set value(v: any) {
20 if (typeof v === 'string') {
23 } else if (v === 'f') {
36 // If true, a null value displays as unset.
37 // If false, a null value displays as an empty string.
39 @Input() set ternary(t: boolean) {
42 get ternary(): boolean {