Trying to remove the node at Palette upon a "ModelChanged" activity in angular, but seems not recognizing the palette at All..
// initialize diagram / templates
public initDiagram(): go.Diagram {
const $ = go.GraphObject.make;
let dia = $(go.Diagram, {
'undoManager.isEnabled': true,
'clickCreatingTool.archetypeNodeData': { text: 'new node', color: 'lightblue' },
"ModelChanged": e => {
if (e.isTransactionFinished) {
this.myPaletteComponent.palette.commandHandler.deleteSelection();
console.log(this.myDiagramComponent.diagram.model.nodeDataArray)
}
},
model: $(go.GraphLinksModel,
{
nodeKeyProperty: 'id',
linkToPortIdProperty: 'toPort',
linkFromPortIdProperty: 'fromPort',
linkKeyProperty: 'key' // IMPORTANT! must be defined for merges and data sync when using GraphLinksModel
}
)
});