I want to show an alert when the user selects the checkbox.We have created alert service as a shared component.Because every module is using that.
My code is like:
if(this.checkboxvalue)
{
this.alertservice.error('Hello again! This is how we add line breaks to an alert box!')
}
I want to show the alert like
Hello again! This is how we add
line breaks to an alert box!
But it displays in a single line.
I tried \n, \\n ,<br\>
But nothing seems to work.
Can anyone help me with this?
Thanks in advance :)
` (or `
`), not `
` as you indicate in what you tried. That backslash before the `>` would render the tag ineffective. If the `alertservice` is injecting it as text, you could try `\r\n`. – MikeJ Feb 07 '20 at 05:50