Ngx-toastr: Change Icon inside of individualOptions

Created on 29 Jun 2018  路  3Comments  路  Source: scttcper/ngx-toastr

I can't change the icon only in a modal? Only in presets of GlobalOoptions?

Most helpful comment

You could do something like this:

this.toastrService.show('Display my custom icon', 'Toast title', {}, 'my-custom-class');

Then don't forget to add my-custom-class to your css to specify the background-image (the icon) and the background color that you want it to have.

Edit: You shouldn't have to override any global options to display your own custom icon (with a custom class). I've removed that part from the example.

All 3 comments

try the toastClass individual config?

You could do something like this:

this.toastrService.show('Display my custom icon', 'Toast title', {}, 'my-custom-class');

Then don't forget to add my-custom-class to your css to specify the background-image (the icon) and the background color that you want it to have.

Edit: You shouldn't have to override any global options to display your own custom icon (with a custom class). I've removed that part from the example.

Thank you people!

Was this page helpful?
0 / 5 - 0 ratings