Skip to content

Commit

Permalink
feat(entity table): support unsanitized html renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
cbourget committed May 6, 2019
1 parent 405582c commit 3e6e98d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
[innerHTML]="getValue(entity, column)">
</td>
</ng-container>
<ng-container *ngIf="columnRenderer === entityTableColumnRenderer.UnsanitizedHTML">
<td mat-cell *matCellDef="let entity" class="mat-cell-text"
[ngClass]="getCellClass(entity, column)"
[innerHTML]="getValue(entity, column) | sanitizeHtml">
</td>
</ng-container>
<ng-container *ngIf="columnRenderer === entityTableColumnRenderer.Icon">
<td mat-cell *matCellDef="let entity" class="mat-cell-text"
[ngClass]="getCellClass(entity, column)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
MatCheckboxModule
} from '@angular/material';

import { IgoCustomHtmlModule } from '../../custom-html/custom-html.module';
import { EntityTableRowDirective } from './entity-table-row.directive';
import { EntityTableComponent } from './entity-table.component';

Expand All @@ -19,7 +20,8 @@ import { EntityTableComponent } from './entity-table.component';
MatTableModule,
MatSortModule,
MatIconModule,
MatCheckboxModule
MatCheckboxModule,
IgoCustomHtmlModule
],
exports: [
EntityTableComponent
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/lib/entity/shared/entity.enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum EntityOperationType {
export enum EntityTableColumnRenderer {
Default = 'Default',
HTML = 'HTML',
UnsanitizedHTML = 'UnsanitizedHTML',
Icon = 'Icon'
}

Expand Down

0 comments on commit 3e6e98d

Please sign in to comment.