Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Angular 'this' reference undefined within Set function each

$
0
0

@dev wrote:

I'm able to handle diagram events of objects dropped, and extract the data from the node model from the palette that is copied over to the diagram via console.log. When I try to call a function from the each Set iterator, the called function (nodeHanlder) is not recognized. Using angular with IntellJ with chrome on osx. The error is telling me that the Angular object doesn't exist.

core.es5.js:1020 ERROR TypeError: Cannot read property 'nodeHandler' of undefined

 this.diagram.addDiagramListener('ExternalObjectsDropped', this.objectDroppedHandler);

objectDroppedHandler(e: DiagramEvent): void {
        e.subject.each( (node) => **this.nodeHandler(node));**
    }

nodeHandler(node: go.Node): void { }

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles