I’m trying to generate data property of a node which is created by dragging a node from the palette to the diagram. I do it in the function below (taken from Angular Basic sample)
public diagramModelChange(changes: go.IncrementalData): void {
this.skipsDiagramUpdate = true;
this.hasChanged = changes !== null;
// initialize node data
if (changes.modifiedNodeData.length) {
changes.modifiedNodeData[0].stepDefinitionCode = 'generated';
}
this.diagramNodeData = DataSyncService.syncNodeData(changes, this.diagramNodeData);
this.diagramLinkData = DataSyncService.syncLinkData(changes, this.diagramLinkData);
this.diagramModelData = DataSyncService.syncModelData(changes, this.diagramModelData) as any;
}
the stepDefinitionCode is set but when reaching the inspector code, the value is an empty string (as definied in the palette below :
public paletteNodeData: Array<go.ObjectData> = [
{ key: 'PaletteTaskNode', color1: 'white', color2: 'green', figure: 'RoundedRectangle', label: 'Task', stepDefinitionCode: '' },
];
How come the model is not properly updated ? Is this the right place for doing this ?