diff --git a/src/lib/services/toaster.service.ts b/src/lib/services/toaster.service.ts index bd22d05..75d44fb 100644 --- a/src/lib/services/toaster.service.ts +++ b/src/lib/services/toaster.service.ts @@ -26,6 +26,7 @@ export interface ToasterOptions extends IndividualConfig { */ readonly params?: Record; readonly actions?: ToasterActions[]; + readonly useRaw?: boolean; } export interface ErrorToasterOptions extends ToasterOptions { @@ -86,16 +87,16 @@ export class Toaster { notificationType = NotificationType.INFO, options?: Partial, ): ActiveToast { - const translatedMsg = this._translateService.instant(message, options?.params) as string; + const msg = options?.useRaw ? message : (this._translateService.instant(message, options?.params) as string); switch (notificationType) { case NotificationType.SUCCESS: - return this._toastr.success(translatedMsg, options?.title, options); + return this._toastr.success(msg, options?.title, options); case NotificationType.WARNING: - return this._toastr.warning(translatedMsg, options?.title, options); + return this._toastr.warning(msg, options?.title, options); case NotificationType.INFO: default: - return this._toastr.info(translatedMsg, options?.title, options); + return this._toastr.info(msg, options?.title, options); } } }