Update property value with UI designer
Hello,
I have a custom widget where I not able to update the property value.
I did a simplified version of this widget as it follows here:
Template: just a link element () with id=a (your forum is parsing html )
Controller:
function ($scope) {
var a = document.getElementById("a");
a.innerHTML = "Save scope value";
a.addEventListener("click", function(event){
console.log("event detected");
updateValue();
});updateValue = function(){
console.log("passing here");
$scope.properties.value = "updated value";
};
$scope.properties.value = "init value";}
And then I created a property called value of type "Biderectional bond".
I'd expect that when I click on the link with id="a" the property is updated, but the value is always = "init value".
I can see the message "passing here" logged.
How can I fix this?
Please help
thanks
Hello,
This was a issue in the scope.
You have to develop in Angular, not in Javascript actualy.
Here the HTML
Click Me to update
==> No more ID, just add a ng-click
Then the controller is simplest
function ($scope) {
var vm = this;
this.updateValue = function(){
console.log("passing here");
$scope.properties.value = "second update";
};
}
That's it!
Comments
Yes I'm doing like you are suggesting.
Here you are! done in 7.11.4
https://we.tl/t-NsUX2dY2pO
Thanks