dominique-mueller / angular-notifier

A well designed, fully animated, highly customizable, and easy-to-use notification library for your Angular application.
https://www.npmjs.com/package/angular-notifier
MIT License
247 stars 68 forks source link

How to display a message of multi lines? #157

Open wureka opened 4 years ago

wureka commented 4 years ago

How to display a message of multi lines?

I have tried

this.notifier.notify('error', 'HELLO, World<br/>line2\nline3');

all don't work.

dominique-mueller commented 3 years ago

By default, the notification title can only be a string. Otherwhise, we would have to circumvent the integrated Angular XSS protection.

You could, though, use a custom template to use custom HTML, such as line breaks. See:

Javrd commented 3 years ago

What if I'm using it as a global service, from where I do the notifier.show() instead from the component? Have I to pass the template from every component that use it? Or am I missing something?

Javrd commented 3 years ago

I'm using at the moment this workaround:

::ng-deep .notifier__notification-message {
  white-space: pre-line;
}
NazimMertBilgi commented 5 months ago

I'm using at the moment this workaround:

::ng-deep .notifier__notification-message {
  white-space: pre-line;
}

thank you bro. its worked.