I have problem when I want to insert “img” tag into “Diagram Model saved in JSON format”.
Use Page Flow for example:
The original example look like this:
but the “save” button can’t show out the “img” resource document.getElementById("mySavedModel").value = myDiagram.model.toJson();
the result I want is something look like this:
Unless some code sets the Picture.source property to a new value, the TwoWay Binding will not update the data.img model data property.
Why is this important to you? Loading a model with no data.img property will correctly cause the Picture to show the “temp1.jpg” image. For exactly the same reason, if there is no data.text property value, the TextBlock will show the string “Source0”.
Hello Can you show an example please, I have a same case to bind the image in the json?
$(go.Picture,
{ width: 64, height: 64 },
{ sourceCrossOrigin: function(pict) { return "use-credentials"; } },
new go.Binding("source", "path"))
I have used the same pattern to bind the source to the model, but I cannot see the source url in model Json