How to use the angular2-toaster.BodyOutputType.TrustedHtml function in angular2-toaster

To help you get started, we’ve selected a few angular2-toaster examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github forCrowd / WealthFramework / AngularClient / src / main / logger / logger.service.ts View on Github external
getToasterConfig(): ToasterConfig {
    this.toasterConfigured = true;
    return new ToasterConfig({
      bodyOutputType: BodyOutputType.TrustedHtml,
      positionClass: "toast-bottom-right"
    });
  }
github bitwarden / desktop / src / app / app.component.ts View on Github external
title: msg.title,
        };
        if (typeof (msg.text) === 'string') {
            toast.body = msg.text;
        } else if (msg.text.length === 1) {
            toast.body = msg.text[0];
        } else {
            let message = '';
            msg.text.forEach((t: string) =>
                message += ('<p>' + this.sanitizer.sanitize(SecurityContext.HTML, t) + '</p>'));
            toast.body = message;
            toast.bodyOutputType = BodyOutputType.TrustedHtml;
        }
        if (msg.options != null) {
            if (msg.options.trustedHtml === true) {
                toast.bodyOutputType = BodyOutputType.TrustedHtml;
            }
            if (msg.options.timeout != null &amp;&amp; msg.options.timeout &gt; 0) {
                toast.timeout = msg.options.timeout;
            }
        }
        this.toasterService.popAsync(toast);
    }
}
github eosrio / simpleos / src / app / dashboard / referendum / referendum.component.ts View on Github external
this.config = new ToasterConfig({
			positionClass: 'toast-top-right',
			timeout: 10000,
			newestOnTop: true,
			tapToDismiss: true,
			preventDuplicates: false,
			animation: 'slideDown',
			limit: 1,
		});
		const toast: Toast = {
			type: type,
			title: title,
			body: body,
			timeout: 10000,
			showCloseButton: true,
			bodyOutputType: BodyOutputType.TrustedHtml,
		};
		this.toaster.popAsync(toast);
	}
github bitwarden / browser / src / popup / app.component.ts View on Github external
title: msg.title,
        };
        if (typeof (msg.text) === 'string') {
            toast.body = msg.text;
        } else if (msg.text.length === 1) {
            toast.body = msg.text[0];
        } else {
            let message = '';
            msg.text.forEach((t: string) =&gt;
                message += ('<p>' + this.sanitizer.sanitize(SecurityContext.HTML, t) + '</p>'));
            toast.body = message;
            toast.bodyOutputType = BodyOutputType.TrustedHtml;
        }
        if (msg.options != null) {
            if (msg.options.trustedHtml === true) {
                toast.bodyOutputType = BodyOutputType.TrustedHtml;
            }
            if (msg.options.timeout != null &amp;&amp; msg.options.timeout &gt; 0) {
                toast.timeout = msg.options.timeout;
            }
        }
        this.toasterService.popAsync(toast);
    }
github eosrio / simpleos / src / app / dashboard / dashboard.component.ts View on Github external
this.config = new ToasterConfig({
			positionClass: 'toast-top-right',
			timeout: 10000,
			newestOnTop: true,
			tapToDismiss: true,
			preventDuplicates: false,
			animation: 'slideDown',
			limit: 1,
		});
		const toast: Toast = {
			type: type,
			title: title,
			body: body,
			timeout: 10000,
			showCloseButton: true,
			bodyOutputType: BodyOutputType.TrustedHtml,
		};
		this.toaster.popAsync(toast);
	}
}
github eosrio / simpleos / src / app / landing / landing.component.ts View on Github external
this.config = new ToasterConfig({
			positionClass: 'toast-top-right',
			timeout: 10000,
			newestOnTop: true,
			tapToDismiss: true,
			preventDuplicates: false,
			animation: 'slideDown',
			limit: 1,
		});
		const toast: Toast = {
			type: type,
			title: title,
			body: body,
			timeout: 10000,
			showCloseButton: true,
			bodyOutputType: BodyOutputType.TrustedHtml,
		};
		this.toaster.popAsync(toast);
	}
github eosrio / simpleos / src / app / dashboard / dapp / dapp.component.ts View on Github external
this.config = new ToasterConfig({
			positionClass: 'toast-top-right',
			timeout: 10000,
			newestOnTop: true,
			tapToDismiss: true,
			preventDuplicates: false,
			animation: 'slideDown',
			limit: 1,
		});
		const toast: Toast = {
			type: type,
			title: title,
			body: body,
			timeout: 10000,
			showCloseButton: true,
			bodyOutputType: BodyOutputType.TrustedHtml,
		};
		this.toaster.popAsync(toast);
	}
github forCrowd / WealthFramework / ng2Client / app / main / modules / logger / logger.service.ts View on Github external
getToasterConfig(): ToasterConfig {
        this.toasterConfigured = true;
        return new ToasterConfig({
            bodyOutputType: BodyOutputType.TrustedHtml,
            positionClass: "toast-bottom-right"
        });
    }
github FundRequest / platform / web / src / main / web / src / app / services / notification / notification.service.ts View on Github external
import { Injectable } from '@angular/core';
import { BodyOutputType, Toast, ToasterConfig, ToasterService } from 'angular2-toaster';

@Injectable()
export class NotificationService {

  private _toastSuccess: Toast = {
    type          : 'success',
    bodyOutputType: BodyOutputType.TrustedHtml,
  };

  private _toastError: Toast = {
    type          : 'error',
    bodyOutputType: BodyOutputType.TrustedHtml,
  };

  constructor(private _ts: ToasterService) {
  }

  public success(title: string = '', body: string = ''): void {
    this._toastSuccess.title = title;
    this._toastSuccess.body = body;
    this._ts.pop(this._toastSuccess);
  }
github eosrio / simpleos / src / app / dashboard / settings / config.component.ts View on Github external
this.config = new ToasterConfig({
			positionClass: 'toast-top-right',
			timeout: 10000,
			newestOnTop: true,
			tapToDismiss: true,
			preventDuplicates: false,
			animation: 'slideDown',
			limit: 1,
		});
		const toast: Toast = {
			type: type,
			title: title,
			body: body,
			timeout: 10000,
			showCloseButton: true,
			bodyOutputType: BodyOutputType.TrustedHtml,
		};
		this.toaster.popAsync(toast);
	}