Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom 161 posts 322 karma points
    Feb 08, 2023 @ 16:46
    Tom
    0

    What's the opposite of notificationsService?

    I am on Umbraco 10. I am injecting the notificationsService into my Javascript files to send out information messages. It works great!

    However, I noticed that notificationsService only has a ".success" method and I have the need to send out a Notification when a user enters something wrong in the backoffice. Note: notificationsService does not offer a ".error" method.

    Does anyone know what service I would use to send out error notifications?

    Thanks

    Tom

  • Johannes Lantz 156 posts 839 karma points c-trib
    Feb 08, 2023 @ 21:21
    Johannes Lantz
    100

    Hi Tom!

    The notificationService should have an "'.error" method. According to the docs you should be able to do something like this:

     notificationsService.error("Document Failed", "booooh");
    

    You can read more about it here: https://apidocs.umbraco.com/v9/ui/#/api/umbraco.services.notificationsService

    //Johannes

  • Tom 161 posts 322 karma points
    Feb 09, 2023 @ 12:55
    Tom
    0

    Thank you very much. That worked. Tom PS For me, Intellisense didn't report a .failure as an option.

Please Sign in or register to post replies

Write your reply to:

Draft