Skip to main content

NotificationService

Provides toast notification functionality.

Example

Ts
class MyComponent {  constructor(private notificationService: NotificationService) {}  save() {    this.notificationService        .success(_('asset.notify-create-assets-success'), {          count: successCount,        });  }}```ts title="Signature"class NotificationService {    constructor(i18nService: I18nService, resolver: ComponentFactoryResolver, overlayHostService: OverlayHostService)    success(message: string, translationVars?: { [key: string]: string | number }) => void;    info(message: string, translationVars?: { [key: string]: string | number }) => void;    warning(message: string, translationVars?: { [key: string]: string | number }) => void;    error(message: string, translationVars?: { [key: string]: string | number }) => void;    notify(config: ToastConfig) => void;}

constructor

method(i18nService: I18nService, resolver: ComponentFactoryResolver, overlayHostService: OverlayHostService) => NotificationService

success

method(message: string, translationVars?: { [key: string]: string | number }) => void

Display a success toast notification

info

method(message: string, translationVars?: { [key: string]: string | number }) => void

Display an info toast notification

warning

method(message: string, translationVars?: { [key: string]: string | number }) => void

Display a warning toast notification

error

method(message: string, translationVars?: { [key: string]: string | number }) => void

Display an error toast notification

notify

method(config: ToastConfig) => void

Display a toast notification.

The types of notification available.

Signature
type NotificationType = 'info' | 'success' | 'error' | 'warning'

Configuration for a toast notification.

Signature
interface ToastConfig {    message: string;    translationVars?: { [key: string]: string | number };    type?: NotificationType;    duration?: number;}

message

propertystring

translationVars

property{ [key: string]: string | number }

type

duration

propertynumber
Was this chapter helpful?
Report Issue
Edited Feb 2, 2026·Edit this page