Link Shape.fromArrow/toArrow Two way binding not working

Hi,

In this example Plunker - Untitled,
After clicking click here button I am trying to modify the Link shape.fromArrow and toArrow to “”. But it not reflecting to diagram why?. I have added two way binding to shape eventhough it’s not working.

I can’t read your code because Plunker won’t let me scroll your code. (I’m on a tablet.) So I can only guess.

Does your button’s onclick handler conduct a transaction?

Are you using the debug library and checking for warnings or errors?

In this sample GoJS Arrowheads, I have added Click button and written its functionality as

function changeArrowHead() {
mydiagram.links.each(e=> {
e.diagram.startTransaction(“link”);
e.data.fromArrow=“”;
e.data.toArrow=“”;
e.diagram.commitTransaction(“link”);
});
console.log(mydiagram.model.toJson())
// mydiagram.rebuildParts();
}

and Link template I have added makeTwoWay() for both fromArrow and ToArrow shape.

In console it’s printing link data as fromArrow/toArrow=“”(as expected). But it is reflecting visually in diagram. If I used Diagram.rebuiltParts then it’s working. I need to change the arrow head without calling Diagram.rebuiltParts

If you change some property value of some JavaScript Object by doing:

   data.someProp = 17;

GoJS does not know that it changed value, so it cannot update anything.

Instead you should call Model.setDataProperty. Besides notifying GoJS about the property change, it also records the previous value in order to support undo/redo.

Please read GoJS Using Models -- Northwoods Software.