i m doing something like this on click-event
e=>this.nodeDoubleClick(this,e)
in js the click event could passed the obj as a parameter but in angular i cant seem to get the obj
this.nodeDoubleClick(e,obj)
i need to get the obj that clicked that called the function
Are you defining an event handler for GraphObject.click? GraphObject | GoJS API
If so, the second argument is the GraphObject whose click property was set to that event handler. As the documentation states:
If this property value is a function, it is called with an InputEvent and this GraphObject.
By the way, no GoJS property whose value is a function is ever called with this
bound to anything. That makes using GoJS friendlier when using arrow functions.
i got it to work can u tell me how to define the diagram layout in angular 6?
there are not much examples of angular
That has nothing to do with Angular or even TypeScript. You have to assign Diagram.layout a new instance of a Layout, not a class (i.e. a constructor).
layout: // Diagram has simple horizontal layout
Go(go.GridLayout,
{ wrappingWidth: Infinity, alignment: go.GridLayout.Position, cellSize: new go.Size(1, 1) }),
i did this in js.
i need to convert my diagram to angular
Assuming you have “Go” defined the same way (as a synonym for go.GraphObject.make
), why wouldn’t the same code work?
thankx got it