Issue
I'm using Angular 5 with ngx-toastr. I have used the following code which renders HTML tag along with the message like: Hi<b>Hello</b>
which is not expected.
this.toastr.warning("Hi<b>Hello</b>");
Also, I used the below code which has no console error neither any output (popup):
this.toastr.show("<font color=\"red\">Hi<b>Hello</b></red></font>",null,{
disableTimeOut: true,
tapToDismiss: false,
closeButton: true,
positionClass:'bottom-left',
enableHtml:true
});
How can I enable HTML in ngx-toastr so that message can looks like: hiHello
Solution
Change your configuration as follows as the order of parameter matters,
this.toastr.show('<font color=\"red\">Hi<b>Hello</b></red></font>"',
'title' , {
enableHtml: true,
closeButton: true,
timeOut: 10000
});
Answered By - Sajeetharan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.