Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to display a message of multi lines? #157

Open
wureka opened this issue Feb 14, 2020 · 4 comments
Open

How to display a message of multi lines? #157

wureka opened this issue Feb 14, 2020 · 4 comments
Labels
support Indicates a request for help / clarification

Comments

@wureka
Copy link

wureka commented Feb 14, 2020

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 dominique-mueller added type: feature Indicates a feature or enhancement support Indicates a request for help / clarification and removed type: feature Indicates a feature or enhancement labels Mar 10, 2021
@dominique-mueller
Copy link
Owner

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
Copy link

Javrd commented Jun 7, 2021

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
Copy link

Javrd commented Jun 7, 2021

I'm using at the moment this workaround:

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

@NazimMertBilgi
Copy link

I'm using at the moment this workaround:

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

thank you bro. its worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Indicates a request for help / clarification
Projects
None yet
Development

No branches or pull requests

4 participants