作者:Hub-of-all-Thing
项目:Rumpe
transform(message: string, replaceUrls: boolean = false): SafeHtml {
if (typeof message === 'string') {
const html = replaceUrls ? SafeHtmlPipe.replaceUrlsWithHtmlLinks(message) : message;
return this.sanitizer.sanitize(SecurityContext.HTML, html);
} else {
return message;
}
}
作者:xety
项目:jhipster-uaa-setu
factory(alertOptions): any {
var alert = {
type: alertOptions.type,
msg: this.sanitizer.sanitize(SecurityContext.HTML, alertOptions.msg),
id: alertOptions.alertId,
timeout: alertOptions.timeout,
toast: alertOptions.toast,
position: alertOptions.position ? alertOptions.position : 'top right',
scoped: alertOptions.scoped,
close: function (alerts) {
return this.closeAlert(this.id, alerts);
}
};
if (!alert.scoped) {
this.alerts.push(alert);
}
return alert;
}