Hi Team,
We are integrating GOjs basic app into the application and below are the code and error message we are getting. We are
That looks like a TypeScript error that requires fixing your code. But I’m not sure what the code is.
I am using the exact same binding as the Sample example.i am not able to get the diagram in Snippet
DiagramComponent
What was that sample binding?
What is your code that the TypeScript compiler is complaining about?
Are you not talking about a Binding in GoJS? I still cannot see the code that the TypeScript compiler is complaining about.
I still cannot tell which line is which.
Does the code run correctly? If so, add a cast to avoid the compiler error.
okay I will type cast
one more issue I am not able to initial the diagram I am using the same binding as Sample go js angular example is given in the git hub
public ngAfterViewInit(): void {
if (this.observedDiagram) { return; }
this.observedDiagram = this.myDiagramComponent.diagram;
}
here observedDiagram is null
The original code is correct – the value of Overview.observed needs to be an instance of a Diagram, not some HTMLDivElement.
Each of those components should automatically create the corresponding Diagram, Palette or Overview. That’s what those initDiagram and initPalette functions are for.
I’m assuming that your app wants to use at least one of each of these kinds of diagrams.
Yes, in my app we have to use the palette and diagram. I am using the same code and structure to load the diagram as the sample code uses but DiagramComponent is not creating that one in my app.I am not sure where I am lagging.
Can you please guide me on that?
When you debug the code, do each of those “init…” functions get called and successfully return a Diagram , Palette or Overview?
You need to look at your code and figure out what the TypeScript compiler is complaining about. Then you can decide how to resolve the coding error.
Basically it is not taking the ObjectData as type and it taking writable draft object
As you can see in the go.d.ts definitions file:
export interface ObjectData {
[index: string]: any;
}
In other words, it’s any JavaScript Object.