Skip to content

Actionable System Notifications

Compare
Choose a tag to compare
@yogeshgadge yogeshgadge released this 06 Apr 17:57
· 135 commits to master since this release

ngx-cbp-theme-system-notifications

  • New component to create CBP Theme styled toast notifications.
  • Notifications can be created using as simple as calling CBPNotificationsService.notify(notification: CBPNotification) passing in textual message and type type?: 'success' | 'danger' | 'warning' | 'info';
  • You can also project your markup by passing your TemplateRef as shown below and in e.g. DemoNotificationsComponent.notifyWarning
    @ViewChild('warnNotification') warnNotificationRef: TemplateRef<any>;

    notifyWarning() {
        this.snoozingNotification = new CBPNotification();
        this.snoozingNotification.type = 'warning';
        this.snoozingNotification.content = this.warnNotificationRef;
        this.notificationService.notify(this.snoozingNotification);
    }
  • Provided actions in the template will get the the local.
  • CBPNotificationsService.snooze(notification: CBPNotification, wakeUpAfter = 5000) can snooze a notification and it will reappear after the wake up time is elapsed.
  • Notification can be programmatically closed by calling close() on the notification object.
  • CBPNotification.isOpen(): Observable<boolean> to observe if open.
  • BREAKING cbp-toggle-switch now accepts projection of ngModel instead of isOn property.