This commit is contained in:
Andrea Chiapparelli - 4Science
2018-03-09 12:53:04 +01:00
parent 21d0b74a77
commit 360784c1bb
4 changed files with 130 additions and 54 deletions

View File

@@ -127,8 +127,12 @@ export class NotificationComponent implements OnInit, OnDestroy {
private contentType(item: any, key: string) {
if (item instanceof TemplateRef) {
this[key] = item;
} else if (key === 'title' || key === 'content' ) {
this[key] = isNotEmpty(item) ? item : Observable.of('');
} else if (key === 'title' || key === 'content') {
this[key] = isNotEmpty(item) ?
typeof item === 'string' ?
Observable.of(item)
: typeof item === 'object' && isNotEmpty(item.payload) ? Observable.of(item.payload) : null
: null;
} else {
this[key] = this.domSanitizer.bypassSecurityTrustHtml(item);
}