src/lib/cells/boolean-cell/boolean-cell.component.ts
changeDetection | ChangeDetectionStrategy.OnPush |
host | { |
selector | td[rxap-boolean-cell] |
imports |
NgIf
MatIconModule
|
styleUrls | ./boolean-cell.component.scss |
templateUrl | ./boolean-cell.component.html |
Inputs |
rxap-boolean-cell | |
Type : any | null
|
|
Default value : null
|
|
import {
ChangeDetectionStrategy,
Component,
Input,
} from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { NgIf } from '@angular/common';
@Component({
// eslint-disable-next-line @angular-eslint/component-selector
selector: 'td[rxap-boolean-cell]',
templateUrl: './boolean-cell.component.html',
styleUrls: ['./boolean-cell.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'rxap-boolean-cell' },
imports: [NgIf, MatIconModule]
})
export class BooleanCellComponent {
@Input('rxap-boolean-cell')
public value: any | null = null;
}
<ng-template [ngIfElse]="isFalse" [ngIf]="value">
<mat-icon class="truthy">check_circle</mat-icon>
</ng-template>
<ng-template #isFalse>
<mat-icon class="falsy">cancel</mat-icon>
</ng-template>
<ng-content></ng-content>
./boolean-cell.component.scss