notification/src/notification.service.ts
Notification service allows consuming apps to create and manage notifications.
@talenra/icons is available)private service: NotificationService = inject(NotificationService);
protected addNotification(): void {
this.service.addNotification({ message: 'Hello world!' });
});import { NotificationService } from '@talenra/components/notification';
Methods |
|
| Public addNotification | |||||||||
addNotification(context: INotificationContext, removeCallback?: TRemoveNotificationCallback)
|
|||||||||
|
Creates and displays a new Notification. Context (message, type, icon, …) is provided in first parameter. The second parameter takes an optional callback that is invoked when the notification is about to be removed. Returns a unique identifier for the notification, which is typically stored in the consuming app (e.g. to remove the notification later). Example :
Parameters :
Returns :
string
|
| Public removeAllNotifications | ||||||||
removeAllNotifications(options: IRemoveNotificationOptions)
|
||||||||
|
Removes all notifications. By default the removal is animated. Use the
Parameters :
Returns :
void
|
| Public removeNotification | ||||||||||||
removeNotification(identifier: string, options: IRemoveNotificationOptions)
|
||||||||||||
|
Removes the notification with the identifier given. By default, the removal is animated. Use the
Parameters :
Returns :
void
|