Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I've created a custom data type that saves files to the web server. I have an API JsonController to save the files.
[PluginController("FileSaver")] public class FileSaverApiController : UmbracoAuthorizedJsonController { public async Task<HttpResponseMessage> SaveFiles() { try { // Do stuff } catch (Exception ex) { CREATE NOTIFCATION FOR UMBRACO BACKOFFICE } } }
When there is an error, I would like to display a message in the Umbraco back-office UI.
Is this possible? Thank you!
Hi Ron
There is an Umbraco angular service, called the notificationsService that you can inject into your property editor controller:
https://our.umbraco.org/apidocs/ui/#/api/umbraco.services.notificationsService
and use to raise messages in the backoffice.
So you will need your controller to return the details of the error to your request, and then use the notifications service to send the message about the problem to the backoffice...
notificationsService.error("title", "message");
regards
Marc
Hi Ron,
Just return from server some message and show it with angular "notificationsService".
Example:
angular.module('umbraco').controller('MyController', function ($scope, notificationsService) { notificationsService.add({ headline : 'Custom notification', message : 'My custom notification message', url: 'http://www.colours.nl', sticky : true, type : 'custom' }); });
Thanks,
Alex
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Create Custom Message Notification on a Custom Data Type
I've created a custom data type that saves files to the web server. I have an API JsonController to save the files.
When there is an error, I would like to display a message in the Umbraco back-office UI.
Is this possible? Thank you!
Hi Ron
There is an Umbraco angular service, called the notificationsService that you can inject into your property editor controller:
https://our.umbraco.org/apidocs/ui/#/api/umbraco.services.notificationsService
and use to raise messages in the backoffice.
So you will need your controller to return the details of the error to your request, and then use the notifications service to send the message about the problem to the backoffice...
regards
Marc
Hi Ron,
Just return from server some message and show it with angular "notificationsService".
Example:
Thanks,
Alex
is working on a reply...