Integrating services with a property editor
Overview
Injecting the service
angular.module("umbraco")
.controller("SuggestionPluginController",
// inject Umbraco's assetsService and editor service
function ($scope, notificationsService) { ... }Hooking into Textbox
// function to show custom notification
$scope.showNotification = function () {
if ($scope.model.value.length > 35) {
notificationsService.add({
// the path of our custom notification view
view: "/App_Plugins/Suggestions/notification.html",
// arguments object we want to pass to our custom notification
args: {
value: $scope.model.value,
callback: $scope.TrimText
}
});
}
};Add the directive in the suggestion.html
suggestion.htmlAdd the JavaScript file in package.manifest
package.manifestCreating custom Notification View and Controller

Wrap up
Last updated
Was this helpful?