Reputation: 31
Is it possible to change an server attribute using the custom action option in a widget? Thanks for help
Upvotes: 0
Views: 839
Reputation: 559
let attributeService = widgetContext.$injector.get(widgetContext.servicesMap.get('attributeService'));
let attributes = [{
"key": YOUR_ATTRIBUTE_KEY,
"value": YOUR_ATTRIBUTE_VALUE
}];
attributeService.saveEntityAttributes(entityId, 'SERVER_SCOPE', attributes).
subscribe(
() => {
console.log('Saved!');
},
error => {
console.log('Error');
}
);
Upvotes: 0