Hi, Managed to modify the angular components of a diagram with the angular basic example. Request your help for the below issue…
A normal “changedSelection” event in the diagram is not executed as previous like below
//
“ModelChanged”: e => {
if (e.isTransactionFinished) {
// allChecks(true);
myPaletteSmall.commandHandler.deleteSelection();
console.log(myDiagram.model.nodeDataArray)
console.log(myPaletteSmall.model.nodeDataArray)
//
Above is working well upon a drop from palette to diagram VS with a proper structure of public methods as per angular basic reference… Is not allowing to call the palette or diagram nodes
Have initialized and updated the “ngAfterViewInit” with reference to Angular library as well
//
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.palette.allowDelete;
console.log(this.diagram.model.nodeDataArray);
removeFromPalette();
}
},
});
public diagram: go.Diagram = null;
public palette: go.Palette = null;
public observedDiagram = null;
public ngAfterViewInit() {
const appComp: AppComponent = this;
if (this.diagram) return (this.diagram = this.myDiagramComponent.diagram);
if (this.palette) return (this.palette = this.myPaletteComponent.palette);
if (this.observedDiagram) return;
this.observedDiagram = this.myDiagramComponent.diagram;
}