diff --git a/addon/services/notification-messages-service.js b/addon/services/notification-messages-service.js index 04342f6d..0ab229c5 100644 --- a/addon/services/notification-messages-service.js +++ b/addon/services/notification-messages-service.js @@ -25,6 +25,7 @@ const NotificationMessagesService = ArrayProxy.extend({ const notification = Ember.Object.create({ message: options.message, type: options.type || 'info', + component: options.component, autoClear: (isEmpty(options.autoClear) ? getWithDefault(globals, 'autoClear', false) : options.autoClear), clearDuration: options.clearDuration || getWithDefault(globals, 'clearDuration', 5000), onClick: options.onClick, diff --git a/addon/templates/components/notification-message.hbs b/addon/templates/components/notification-message.hbs index 766796aa..9f0b5ff7 100644 --- a/addon/templates/components/notification-message.hbs +++ b/addon/templates/components/notification-message.hbs @@ -2,7 +2,9 @@
A custom component may be used for rendering the message
+ + {{#themed-syntax lang="htmlbars" theme="dark" class="h5" withBuffers=false}} +<h1>{{message.title}}</h1> +<span class='count'>{{message.count}}</span> + {{/themed-syntax}} + + {{#themed-syntax lang="js" theme="dark" class="h5" withBuffers=false}} +let message = { + title: 'You have unread messages', + count: 3, +}; + +this.get('notifications').info(message, { + component: 'unread-message' +}); + {{/themed-syntax}} +You can enable basic HTML markup for notification messages.
Warning: This introduces a potential security risk since the notification message will no longer be escaped by Ember.