I use gojs with Angular wrapper.
In my diagram template definition I do the following :
$(go.Shape, // the arrowhead
{ fromArrow: '' }, //default value
new go.Binding('fromArrow', 'transitionType', (transitionType, shape) =>
// links lookup are stored in modelData so find the relevant one
shape.part.diagram.model.modelData.links.find(l => l.transitionType === transitionType).fromArrow
)),
It works fine when the diagram is already loaded and I drag one of my links from the palette. The binding works.
However when loading an existing diagram, the binding is not done because modelData has no properties (so links is undefined).
Is there a way to make sure the modelData is populated before the diagram template is created ?
Currently this property is set in ngOnInit :
//initialize model data (lookup data used)
this.diagramModelData.links = this._processDesignerService.processDesignerMetadata.paletteLinks;