Nodes are not changing position after setting its loc property

We are having an angular application and we are using diagram as directive.
In the diagram we have two templates

GO(go.Node, “Spot”,
new go.Binding(“location”, “loc”, go.Point.parse).makeTwoWay(go.Point.stringify),
margin : 5,
maxSize: new go.Size(280, NaN),
width: 280,
textAlign: ‘left’,
alignment: go.Spot.Bottom,
editable: true,
isMultiline: true

									 new go.Binding("text").makeTwoWay(), 
									 new go.Binding("font", "font").makeTwoWay(),
									 new go.Binding("stroke", "stroke").makeTwoWay(),
									 new go.Binding("background", "lightgreen"))								 
		       GO(go.Node, "Spot",	
		    		new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
		          GO(go.Panel, "Horizontal",
		                name: "Picture",
		                maxSize: new go.Size(250, 250),
		                margin: new go.Margin(5, 5, 5, 5),
		              new go.Binding("source", "source"))			            

In the text edited event of textblock, we are trying to move the picture node to some other position using

$scope.model.setDataProperty(, ‘loc’, locPosition);
It is changing the position only in the second event. Can you please help us in this regard.

It’s probably easiest to just set imageNode.location. If there’s a TwoWay Binding on the Node.location, the model data will be updated at the same time.

It’s also unnecessary to start a transaction, since the TextBlock.textEdited event handler is called within the transaction conducted by the TextEditingTool.

This too didn’t work. Any other option

Setting Node.location will definitely move the node. Perhaps a Layout is moving it back for some reason? I’m just guessing, since I have no idea of what is happening nor exactly what you want to happen.

Actually I was changing location in the text edited event based on the height of the edited textblock. In the text edited event the textblocks actual bounds was not changed. That’s why the change is not happening. In which event we will get textblocks actual bounds after editing

Yes, that’s right – the Node holding the TextBlock may need to be re-laid-out again. And that might cause the Layout to be invalidated and then performed again, causing nodes to be moved.